After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 602862 - GAsyncReadyCallback default scope
GAsyncReadyCallback default scope
Status: RESOLVED FIXED
Product: gobject-introspection
Classification: Platform
Component: general
unspecified
Other Linux
: Normal normal
: ---
Assigned To: gobject-introspection Maintainer(s)
gobject-introspection Maintainer(s)
Depends on:
Blocks:
 
 
Reported: 2009-11-24 19:08 UTC by Colin Walters
Modified: 2015-02-07 16:46 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Better scope in GAsyncReadyCallback/GDestroyNotify (8.95 KB, patch)
2009-11-25 00:20 UTC, Johan (not receiving bugmail) Dahlin
none Details | Review
Better scope in GAsyncReadyCallback/GDestroyNotify (10.30 KB, patch)
2009-11-25 00:24 UTC, Johan (not receiving bugmail) Dahlin
none Details | Review
Better scope in GAsyncReadyCallback/GDestroyNotify (11.53 KB, patch)
2009-11-25 10:44 UTC, Johan (not receiving bugmail) Dahlin
none Details | Review
Better scope in GAsyncReadyCallback/GDestroyNotify (11.43 KB, patch)
2009-11-25 10:47 UTC, Johan (not receiving bugmail) Dahlin
needs-work Details | Review

Description Colin Walters 2009-11-24 19:08:19 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
Comment 1 Owen Taylor 2009-11-24 19:14:28 UTC
And it should error (or skip the function) if neither is true and scope isn't annotated!
Comment 2 Johan (not receiving bugmail) Dahlin 2009-11-25 00:20:15 UTC
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
Comment 3 Johan (not receiving bugmail) Dahlin 2009-11-25 00:24:32 UTC
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
Comment 4 Dan Winship 2009-11-25 00:39:11 UTC
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.
Comment 5 Johan (not receiving bugmail) Dahlin 2009-11-25 10:44:39 UTC
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.
Comment 6 Johan (not receiving bugmail) Dahlin 2009-11-25 10:47:46 UTC
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 7 Dan Winship 2009-11-30 14:33:08 UTC
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.
Comment 8 Johan (not receiving bugmail) Dahlin 2009-12-02 12:32:08 UTC
The following fixes have been pushed:
Comment 9 André Klapper 2015-02-07 16:46:35 UTC
[Mass-moving gobject-introspection tickets to its own Bugzilla product - see bug 708029. Mass-filter your bugmail for this message: introspection20150207 ]