GNOME Bugzilla – Bug 739879
Not handling (transfer full) arguments properly
Last modified: 2014-11-11 03:13:18 UTC
See attached hackish patch (that also breaks the API) to handle (transfer full) arguments properly. Before seed did not get another reference, which would mean that the function and seed shared the only reference. If that function now keeps the reference around a bit longer in some data structure, seed might decide to unref it... destroying the object and leaving some pointer pointing to some object that does not exist anymore. Which is exactly what happened to me. Are there better ways to handle this in the current codebase without breaking the API? The same problem seems to be there in other situations too, also in the other way around (transfer full return values or out parameters) and in general quite a few places where reference counting looks weird (most of them with a FIXME comment already). Is someone planning to work on these things?
Created attachment 290337 [details] [review] seed-types: Keep another reference around for seed when handling (transfer full) function arguments
I think this is the only way to handle it as well the FIXME's are there, but no big plans to address them, as at present I'm working on other things. I've committed this in Regards Alan