mirror of
				https://github.com/libsdl-org/SDL.git
				synced 2025-10-26 12:27:44 +00:00 
			
		
		
		
	mac: Fix SDLWindow nswindow member no longer being cleaned up in Cocoa_DestroyWindow
- A refactor changed how SetupWindowData handled external windows where previously it was tracked in a field of SDL_CocoaWindowData but now it is tracked by setting SDL_WINDOW_EXTERNAL in the window flags. Removed the now unused field and updated the external window check in DestroyWindow.
This commit is contained in:
		| @@ -132,7 +132,6 @@ typedef enum | |||||||
| @property(nonatomic) NSWindow *nswindow; | @property(nonatomic) NSWindow *nswindow; | ||||||
| @property(nonatomic) NSView *sdlContentView; | @property(nonatomic) NSView *sdlContentView; | ||||||
| @property(nonatomic) NSMutableArray *nscontexts; | @property(nonatomic) NSMutableArray *nscontexts; | ||||||
| @property(nonatomic) SDL_bool created; |  | ||||||
| @property(nonatomic) BOOL in_blocking_transition; | @property(nonatomic) BOOL in_blocking_transition; | ||||||
| @property(nonatomic) BOOL was_zoomed; | @property(nonatomic) BOOL was_zoomed; | ||||||
| @property(nonatomic) NSInteger window_number; | @property(nonatomic) NSInteger window_number; | ||||||
|   | |||||||
| @@ -2830,7 +2830,8 @@ void Cocoa_DestroyWindow(SDL_VideoDevice *_this, SDL_Window *window) | |||||||
|             } |             } | ||||||
|             [data.listener close]; |             [data.listener close]; | ||||||
|             data.listener = nil; |             data.listener = nil; | ||||||
|             if (data.created) { |  | ||||||
|  |             if (!(window->flags & SDL_WINDOW_EXTERNAL)) { | ||||||
|                 /* Release the content view to avoid further updateLayer callbacks */ |                 /* Release the content view to avoid further updateLayer callbacks */ | ||||||
|                 [data.nswindow setContentView:nil]; |                 [data.nswindow setContentView:nil]; | ||||||
|                 [data.nswindow close]; |                 [data.nswindow close]; | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 Sam Lantinga
					Sam Lantinga