1
0
mirror of https://github.com/godotengine/godot.git synced 2025-12-30 18:30:54 +00:00

Wayland: Fix accidental copy during global remove

We were accidentally mutating a copy during cleanup of the viewporter
and fractional scale manager.

Thank you Aaron Franke for finding this out :D
This commit is contained in:
Dery Almas
2025-12-12 12:01:06 +01:00
parent bb92a4c8e2
commit b439a71db3

View File

@@ -824,7 +824,7 @@ void WaylandThread::_wl_registry_on_global_remove(void *data, struct wl_registry
if (name == registry->wp_viewporter_name) {
for (KeyValue<DisplayServer::WindowID, WindowState> &pair : registry->wayland_thread->windows) {
WindowState ws = pair.value;
WindowState &ws = pair.value;
if (registry->wp_viewporter) {
wp_viewporter_destroy(registry->wp_viewporter);
registry->wp_viewporter = nullptr;
@@ -862,7 +862,7 @@ void WaylandThread::_wl_registry_on_global_remove(void *data, struct wl_registry
if (name == registry->wp_fractional_scale_manager_name) {
for (KeyValue<DisplayServer::WindowID, WindowState> &pair : registry->wayland_thread->windows) {
WindowState ws = pair.value;
WindowState &ws = pair.value;
if (registry->wp_fractional_scale_manager) {
wp_fractional_scale_manager_v1_destroy(registry->wp_fractional_scale_manager);