Il mar 29 apr 2025, 16:37 Marc-André Lureau <marcandre.lur...@redhat.com> ha scritto:
> Hi > > On Tue, Apr 29, 2025 at 6:23 PM Paolo Bonzini <pbonz...@redhat.com> wrote: > > > > > > > > Il mar 29 apr 2025, 16:03 <marcandre.lur...@redhat.com> ha scritto: > >> > >> From: Marc-André Lureau <marcandre.lur...@redhat.com> > >> > >> Since commit 9859fac ("object: release all props"), the code was changed > >> to tracks the already released properties in a hash table. I am not sure > >> why this was done, perhaps to prevent from potential crashes if > >> properties are being added dynamically during release. I am not sure if > >> it's a valid concern though. > > > > > > You always need object_property_iter_init in case prop->release deletes > a property, thus invalidating the GHashTable iterator. The hash table > instead is needed in case prop->release does *not* delete a property, > because then the property reappears on subsequent recreations of the > iterator. > > Yes, changing the properties while they are being removed is I think > the reason I added the HashTable/Set. But is this a valid concern? > (the penalty is a bit sad) > I think deleting is a possibility... For example releasing a property could trigger an object_unparent(). Since there is no better way to notice I think it's better to keep it. Maybe we could add a generation count to the Object struct? Paolo >