Created attachment 26264 [details] [review] patch As explained on IRC in the python bindings land would be great to have a function to close the document that just calls g_object_unref. About the name I've choosen poppler_document_release because *_free is never used in the python bindings world, we usually kill all the _free functions in the override file. Would be great if this could go into 0.12, thanks in advance
What does pygtk do to solve this problem with GObjects?
Widget are destroyed by pyggobject when the mainloop closes or when the destroy method is called, tp_dealloc is called on the python object and g_object_unref is called on the C reference. This case is different because we want to close the document even if the app is still up and running, I guess in a C app you just unref the document.
As written in https://bugs.launchpad.net/poppler-python/+bug/316722/comments/7. AFAICT the problem is that the binding generators assume that they need to g_object_ref the object created by the *_new functions. When that happens, the last reference to the C object will not be released when python destroys its object. The fix is to tell the binding generator that the return value of the *_new function should not be g_object_ref'ed.
Is this still needed? poppler (git master) has now GObject introspection support, can I assume that bindings generated using introspection will do the right thing?
Closing this report. 1. It was a binding bug to begin with (wrong annotation) 2. Everything works fine with the introspection bindings
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.