On 28/09/2015 10:15, Andreas Färber wrote: > Am 28.09.2015 um 10:11 schrieb Markus Armbruster: >> Hmm, does creating and destroying a macio object leave the memory region >> behind? >> >> Paolo, is calling memory_region_init() in an instance_init() method >> okay? >> >> If yes, where should they be destroyed, and how? > > The counterpart to .instance_init is .instance_finalize aka uninit.
memory_region_init adds the region as a child of the object, so it need not be destroyed anywhere. Lo and behold, it's even documented in docs/memory.txt: "Destruction of a memory region happens automatically when the owner object dies". Paolo