From f5ff0f732a29769fe2ce4f4f5cdb3b447151b1bc Mon Sep 17 00:00:00 2001 From: Daniel van Vugt Date: Fri, 14 Jul 2023 18:08:57 +0800 Subject: [PATCH] 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: --- src/backends/native/meta-onscreen-native.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/backends/native/meta-onscreen-native.c b/src/backends/native/meta-onscreen-native.c index a8b3c1941..eca6425cc 100644 --- a/src/backends/native/meta-onscreen-native.c +++ b/src/backends/native/meta-onscreen-native.c @@ -2483,4 +2483,5 @@ void meta_onscreen_native_detach (MetaOnscreenNative *onscreen_native) { clear_invalidation_handlers (onscreen_native); + onscreen_native->view = NULL; }