Skip to content

Add a (diagnostic) warning for finalized floating objects

Emmanuele Bassi requested to merge ebassi/floating-warning into main

GTK currently checks if a GtkWidget is finalized while still using a floating reference—i.e. a widget was disposed without any parent container owning it.

This warning can be useful to identify and trace ownership transfer issues in libraries using initially unowned floating object types.

To avoid introducing constraints ex post, we can gate this check behind both the G_ENABLE_DEBUG compile time flag for GLib, and behind the G_ENABLE_DIAGNOSTIC environment variable run time check.

Fixes: #2489 (closed)

Merge request reports