Fix #36593: crash duplicating window on OS X in some situations. User data

should be set before GHOST_SetWindowState, since this may generate an event.
This commit is contained in:
Brecht Van Lommel
2013-09-09 16:55:35 +00:00
parent 990e361a2c
commit 60da8c1ae0

View File

@@ -375,12 +375,12 @@ static void wm_window_add_ghostwindow(const char *title, wmWindow *win)
/* needed so we can detect the graphics card below */
GPU_extensions_init();
/* set the state*/
GHOST_SetWindowState(ghostwin, (GHOST_TWindowState)win->windowstate);
win->ghostwin = ghostwin;
GHOST_SetWindowUserData(ghostwin, win); /* pointer back */
/* set the state*/
GHOST_SetWindowState(ghostwin, (GHOST_TWindowState)win->windowstate);
if (win->eventstate == NULL)
win->eventstate = MEM_callocN(sizeof(wmEvent), "window event state");