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 783381 - Wrong introspection annotation for gtk_builder_add_callback_symbol
Wrong introspection annotation for gtk_builder_add_callback_symbol
Status: RESOLVED OBSOLETE
Product: gtk+
Classification: Platform
Component: Language Bindings
unspecified
Other Linux
: Normal normal
: ---
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2017-06-03 12:00 UTC by Iñaki García Etxebarria
Modified: 2018-05-02 18:32 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Patch improving the introspection data (908 bytes, patch)
2017-06-03 12:00 UTC, Iñaki García Etxebarria
none Details | Review

Description Iñaki García Etxebarria 2017-06-03 12:00:59 UTC
Created attachment 353111 [details] [review]
Patch improving the introspection data

The "callback_symbol" argument to gtk_builder_add_callback_symbol is annotated as "(scope async)", but this is incorrect: it implies that the callback will only be called once, and that the bindings can free the wrapping code after the first invocation. But this is clearly not true, since the callback can be invoked more than once, which will then lead to crashes.

A better annotation is "(scope notified)", which leads to a leak but no crash. An even better alternative would be to have a variant of "gtk_builder_add_callback_symbol" with a GDestroyNotify, so there is no leak.

For the moment I simply attached a patch changing the annotation to scope notified to avoid the crash, since this introduces no new API.
Comment 1 GNOME Infrastructure Team 2018-05-02 18:32:51 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to GNOME's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/gtk/issues/830.