GLibSharp / GtkSharp

.Net bindings for gtk+3 and above
Other
27 stars 21 forks source link

Fix finalizers implementation for Opaque subclasses #55

Closed ylatuya closed 3 years ago

ylatuya commented 3 years ago

There was one finalizer being for level of inheritance. For example Gst.Message -> Gst.MiniObject -> GLib.Opaque ends with 2 finalizers being called, one calling gst_mini_object_unreg another one calling gst_message_unref The following implementation will only call once the unref function for the highest class in the hierarchy

Fixes #54

ylatuya commented 3 years ago

I don't have a the correct set-up to re-generate all the sources. I would need someone with the latest sources of all deps to correctly regenerate the bindings.

ylatuya commented 3 years ago

Everything is ready from my side now and the PR is ready for review

thiblahute commented 3 years ago

Have you written a patch for gst-sharp already?

ylatuya commented 3 years ago

I am still setting up the dev env from scratch in macOS, once done I will create a patch for gstreamer-sharp and run the unit tests I have for module using it, which is what triggered the issues with the finalizers.

thiblahute commented 3 years ago

Should we wait for the GSTreamer patches to be ready/tested first?

ylatuya commented 3 years ago

I have been able to test the patch with GStreamer 1.18.0 and everything works correctly now without glib warnings nor crashes. I am unable to build GStreamer from master with GI due to some build issues that I am unable to quickly fix, so I won't be able to provide a patch for gstreamer-sharp from the master branch.

ylatuya commented 3 years ago

I created the following MR in gstreamer-sharp for 1.18 https://gitlab.freedesktop.org/gstreamer/gstreamer-sharp/-/merge_requests/30