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 698988 - Wrong usage of g_object_remove_toggle_ref
Wrong usage of g_object_remove_toggle_ref
Status: RESOLVED FIXED
Product: seed
Classification: Bindings
Component: libseed
git master
Other Linux
: Normal normal
: ---
Assigned To: seed-maint
seed-maint
Depends on:
Blocks:
 
 
Reported: 2013-04-26 18:25 UTC by Alban Crequy
Modified: 2013-04-29 05:50 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
[PATCH] fix toggle refs (1.89 KB, patch)
2013-04-26 18:28 UTC, Alban Crequy
none Details | Review

Description Alban Crequy 2013-04-26 18:25:43 UTC
When an object is unreffed from other C code and the last reference is the seed toggle reference, g_object_remove_toggle_ref() could be called from seed_gobject_finalize() through the javascript garbage collector.

The "data" parameter given to g_object_remove_toggle_ref() must be the same as the one used at g_object_add_toggle_ref-time in seed_wrap_object(), otherwise the toggle callback seed_toggle_ref will not be called and a critical warning "couldn't find toggle ref" might be printed.

Additionally, g_object_run_dispose() must not be called after g_object_remove_toggle_ref() since gobject will be freed by then.
Comment 1 Alban Crequy 2013-04-26 18:28:51 UTC
Created attachment 242607 [details] [review]
[PATCH] fix toggle refs
Comment 2 Alan Knowles 2013-04-29 05:50:42 UTC
commited, thanks