Skip to content

arg: Don't sink GClosure ref if it's a return value

Philip Chimento requested to merge gtk4-builderscope-memory-leak into master

This fixes a memory leak when implementing GtkBuilderScope.vfunc_create_closure. The caller of vfunc_create_closure consumes the floating ref on the GClosure on the C side, by passing it to g_signal_connect_closure_by_id().

Since g-i doesn't say whether the ref is supposed to be floating or not, we have to guess that GClosures going from JS to C are going to be passed to some C API that will consume the floating reference.

Merge request reports