gdbus-codegen: add autocleanup for FooObject
I noticed while working on an application using UDisks that g_autoptr(UDisksObject)
doesn't work, even though I previously modified its build process to add --c-generate-autocleanup all
everywhere. Turns out this generates almost "all" autocleanups, but not quite all: it omits the "${Namespace}Object" wrapper interface.
It's easy to add this to the all
mode but now we're back in the situation discussed on https://bugzilla.gnome.org/show_bug.cgi?id=763379 – what if applications in the wild use --c-generate-autocleanup all
but do their own definition of this one to work around this bug? On that bug, @walters said:
I guess the question is - how likely is it that we'll introduce any future incompatibilities like this?
My instinct says it's pretty unlikely - we'll have learned our lesson from this one hopefully!
but two-and-a-bit years later, here we are. I propose that we just add this and hope that nothing breaks, because it would be sad to have to add a --c-generate-autocleanup really-all
mode!
(I read through the generated code and I believe that anything that has a _get_type()
also now has autocleanups.)