Wrong introspection annotation for gtk_builder_add_callback_symbol
Submitted by Iñaki García Etxebarria
Link to original bug (#783381)
Description
Created attachment 353111 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.
Patch 353111, "Patch improving the introspection data":
0001-Improve-introspection-annotation-for-gtk_builder_add.patch