kms/impl-device/simple: Avoid destroying a NULL hash table

Which would trigger:
```
g_hash_table_destroy: assertion 'hash_table != NULL' failed
```
on non-KMS systems like with `nvidia-drm.modeset=0`.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2904>
This commit is contained in:
Daniel van Vugt 2023-03-08 17:53:23 +08:00
parent 46e1ede687
commit 1be2f635e9

View File

@ -1679,7 +1679,7 @@ meta_kms_impl_device_simple_finalize (GObject *object)
g_clear_pointer (&impl_device_simple->mode_set_fallback_feedback_source, g_clear_pointer (&impl_device_simple->mode_set_fallback_feedback_source,
g_source_destroy); g_source_destroy);
g_hash_table_destroy (impl_device_simple->cached_mode_sets); g_clear_pointer (&impl_device_simple->cached_mode_sets, g_hash_table_destroy);
G_OBJECT_CLASS (meta_kms_impl_device_simple_parent_class)->finalize (object); G_OBJECT_CLASS (meta_kms_impl_device_simple_parent_class)->finalize (object);
} }