소스 검색

wayland: Check the relative pointer handle before destroying

If the relative protocol is unsupported, this will always be null and the destroy function won't be called.

(cherry picked from commit 0e87b71d08c75af8c4b02808038825d3b16bf854)
Frank Praznik 1 년 전
부모
커밋
19c3e125ba
1개의 변경된 파일4개의 추가작업 그리고 2개의 파일을 삭제
  1. 4 2
      src/video/wayland/SDL_waylandevents.c

+ 4 - 2
src/video/wayland/SDL_waylandevents.c

@@ -2668,8 +2668,10 @@ int Wayland_input_unlock_pointer(struct SDL_WaylandInput *input)
         w->locked_pointer = NULL;
     }
 
-    zwp_relative_pointer_v1_destroy(input->relative_pointer);
-    input->relative_pointer = NULL;
+    if (input->relative_pointer) {
+        zwp_relative_pointer_v1_destroy(input->relative_pointer);
+        input->relative_pointer = NULL;
+    }
 
     d->relative_mouse_mode = 0;