Skip to content

onscreen/native: Forget the view pointer when it is detached

Daniel van Vugt requested to merge vanvugt/mutter:null-on-detach into main

Otherwise it would linger after a hotplug event, pointing to the old (destroyed) view. And it's much easier to debug a NULL pointer than a pointer to freed memory.

I actually wanted to use g_object_add_weak_pointer in meta_onscreen_native_set_view but that doesn't seem to work. The weak pointer always comes out NULL. Almost like the view object is created as a floating reference?

Merge request reports