cocoa: Set the internal window data before calling methods that may result in referencing the internal data
This commit is contained in:
@@ -2126,6 +2126,7 @@ static bool SetupWindowData(SDL_VideoDevice *_this, SDL_Window *window, NSWindow
|
|||||||
if (!data) {
|
if (!data) {
|
||||||
return SDL_OutOfMemory();
|
return SDL_OutOfMemory();
|
||||||
}
|
}
|
||||||
|
window->internal = (SDL_WindowData *)CFBridgingRetain(data);
|
||||||
data.window = window;
|
data.window = window;
|
||||||
data.nswindow = nswindow;
|
data.nswindow = nswindow;
|
||||||
data.videodata = videodata;
|
data.videodata = videodata;
|
||||||
@@ -2247,7 +2248,6 @@ static bool SetupWindowData(SDL_VideoDevice *_this, SDL_Window *window, NSWindow
|
|||||||
SDL_SetNumberProperty(props, SDL_PROP_WINDOW_COCOA_METAL_VIEW_TAG_NUMBER, SDL_METALVIEW_TAG);
|
SDL_SetNumberProperty(props, SDL_PROP_WINDOW_COCOA_METAL_VIEW_TAG_NUMBER, SDL_METALVIEW_TAG);
|
||||||
|
|
||||||
// All done!
|
// All done!
|
||||||
window->internal = (SDL_WindowData *)CFBridgingRetain(data);
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user