Просмотр исходного кода

Wayland: Fix leak of surface scaling objects

Camilla Löwy 1 год назад
Родитель
Сommit
42dc1ffaee
2 измененных файлов с 7 добавлено и 0 удалено
  1. 1 0
      README.md
  2. 6 0
      src/wl_window.c

+ 1 - 0
README.md

@@ -123,6 +123,7 @@ information on what to include when reporting a bug.
 
 
  - Added `GLFW_UNLIMITED_MOUSE_BUTTONS` input mode that allows mouse buttons beyond
  - Added `GLFW_UNLIMITED_MOUSE_BUTTONS` input mode that allows mouse buttons beyond
    the limit of the mouse button tokens to be reported (#2423)
    the limit of the mouse button tokens to be reported (#2423)
+ - [Wayland] Bugfix: The fractional scaling related objects were not destroyed
 
 
 
 
 ## Contact
 ## Contact

+ 6 - 0
src/wl_window.c

@@ -2183,6 +2183,12 @@ void _glfwDestroyWindowWayland(_GLFWwindow* window)
     if (window == _glfw.wl.keyboardFocus)
     if (window == _glfw.wl.keyboardFocus)
         _glfw.wl.keyboardFocus = NULL;
         _glfw.wl.keyboardFocus = NULL;
 
 
+    if (window->wl.fractionalScale)
+        wp_fractional_scale_v1_destroy(window->wl.fractionalScale);
+
+    if (window->wl.scalingViewport)
+        wp_viewport_destroy(window->wl.scalingViewport);
+
     if (window->wl.activationToken)
     if (window->wl.activationToken)
         xdg_activation_token_v1_destroy(window->wl.activationToken);
         xdg_activation_token_v1_destroy(window->wl.activationToken);