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

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.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3118>
This commit is contained in:
Daniel van Vugt 2023-07-14 18:08:57 +08:00 committed by Marge Bot
parent 9c021b0bc2
commit f5ff0f732a

View File

@ -2483,4 +2483,5 @@ void
meta_onscreen_native_detach (MetaOnscreenNative *onscreen_native)
{
clear_invalidation_handlers (onscreen_native);
onscreen_native->view = NULL;
}