Skip to content

expression: combine GWeakNotify and GWeakRef for object expression

When using a GtkObjectExpression multiple times in the same GtkBuilder template, we can run into a situation where we are in disposal but have not yet had our callback notified.

This attempts to improve on that situation by using something I've done in other projects for years. Combine both GWeakNotify and GWeakRef. Only use the GWeakRef to get an object instance rather than relying on the GWeakNotify alone.

By doing this, we can avoid trying to remove an object weak reference for an object that is in disposal and causing runtime warnings.

Fixes #5542 (closed) Fixes #6220 (closed)

Merge request reports