[mutter] onscreen/native: Get backend pointer from GPU



commit 023dd13d6c6bdf656ab69be5570f5f2588c98b69
Author: Jonas Ã…dahl <jadahl gmail com>
Date:   Tue Apr 13 16:04:42 2021 +0200

    onscreen/native: Get backend pointer from GPU
    
    If we clean things up during destruction, the singleton pointer to the
    backend is already gone; get it from a better place instead, to not
    crash.
    
    Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1822>

 src/backends/native/meta-onscreen-native.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
---
diff --git a/src/backends/native/meta-onscreen-native.c b/src/backends/native/meta-onscreen-native.c
index 99c9d76107..23acb06815 100644
--- a/src/backends/native/meta-onscreen-native.c
+++ b/src/backends/native/meta-onscreen-native.c
@@ -549,7 +549,8 @@ secondary_gpu_release_dumb (MetaOnscreenNativeSecondaryGpuState *secondary_gpu_s
 static void
 secondary_gpu_state_free (MetaOnscreenNativeSecondaryGpuState *secondary_gpu_state)
 {
-  MetaBackend *backend = meta_get_backend ();
+  MetaGpu *gpu = META_GPU (secondary_gpu_state->gpu_kms);
+  MetaBackend *backend = meta_gpu_get_backend (gpu);
   MetaEgl *egl = meta_backend_get_egl (backend);
 
   if (secondary_gpu_state->egl_surface != EGL_NO_SURFACE)


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]