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

Fixed crash when switching a window from using OpenGL to Metal

Sam Lantinga 1 год назад
Родитель
Сommit
45ecea1346
1 измененных файлов с 2 добавлено и 2 удалено
  1. 2 2
      src/video/uikit/SDL_uikitview.m

+ 2 - 2
src/video/uikit/SDL_uikitview.m

@@ -120,6 +120,8 @@ extern int SDL_AppleTVRemoteOpenedAsJoystick;
         [data.uiwindow layoutIfNeeded];
     }
 
+    sdlwindow = window;
+
     /* Add ourself to the new window. */
     if (window) {
         data = (__bridge SDL_UIKitWindowData *)window->internal;
@@ -144,8 +146,6 @@ extern int SDL_AppleTVRemoteOpenedAsJoystick;
          * layout now to immediately update the bounds. */
         [data.uiwindow layoutIfNeeded];
     }
-
-    sdlwindow = window;
 }
 
 - (SDL_Window *)getSDLWindow