GNOME Bugzilla – Bug 602862
GAsyncReadyCallback default scope
Last modified: 2015-02-07 16:46:35 UTC
<danw> yeah, i think if it uses GAsyncReadyCallback, the scanner should fill in scope=async, and if there's a GDestroyNotify, it should fill in scope=notified
And it should error (or skip the function) if neither is true and scope isn't annotated!
Created attachment 148421 [details] [review] Better scope in GAsyncReadyCallback/GDestroyNotify GAsyncReadyCallback should have use the async scope per default and GDestroyNotify should be notified per default. Fixes
Created attachment 148423 [details] [review] Better scope in GAsyncReadyCallback/GDestroyNotify GAsyncReadyCallback should have use the async scope per default and GDestroyNotify should be notified per default. Fixes bug 602862
oops, not quite what I meant. the GAsyncReadyCallback part is right. For GDestroyNotify, I meant that if you have a function whose signature ends with: SomeCallbackType, gpointer, GDestroyNotify that you should give the SomeCallbackType parameter "notified" scope, not the GDestroyNotify parameter.
Created attachment 148434 [details] [review] Better scope in GAsyncReadyCallback/GDestroyNotify GAsyncReadyCallback should have use the async scope per default and GDestroyNotify should be notified if the previous parameters are a callback and user data.
Created attachment 148435 [details] [review] Better scope in GAsyncReadyCallback/GDestroyNotify GAsyncReadyCallback should have use the async scope per default and GDestroyNotify should be notified if the previous parameters are a callback and user data.
Comment on attachment 148435 [details] [review] Better scope in GAsyncReadyCallback/GDestroyNotify >+ if param.type.name != 'GLib.DestroyNotify': that doesn't work for methods in GLib-2.0.gir >+ elif param.type.name == 'Gio.AsyncReadyCallback': and that doesn't work for methods in Gio-2.0.gir This popped up in bug 602512 with 'GLib.Quark' too. Maybe there should be something like param.type.is('GLib.DestroyNotify') that would DTRT both inside and outside the relevant module? Besides that, I realize now that scope="notified" is completely redundant with the presence of a destroy="N" annotation, so maybe it's unnecessary? Or maybe the destroy="N" is unnecessary? Not sure. There are some "(scope notified)"s in gir/glib-2.0.c that can be removed now.
The following fixes have been pushed:
[Mass-moving gobject-introspection tickets to its own Bugzilla product - see bug 708029. Mass-filter your bugmail for this message: introspection20150207 ]