From 1e00590f1c2f8d98ed52f8e12d70723165edc9d3 Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Mon, 23 May 2011 15:56:26 +0000 Subject: Fix #26728: crash with load/save on Mac, on files that close & open a window when loading them. Custom cursor shown during load was not freed correctly when closing the old window, which resulted in unpredictable crashes later on. --- intern/ghost/intern/GHOST_WindowCocoa.mm | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'intern') diff --git a/intern/ghost/intern/GHOST_WindowCocoa.mm b/intern/ghost/intern/GHOST_WindowCocoa.mm index 8d28c9d5b17..fb7d4a459c7 100644 --- a/intern/ghost/intern/GHOST_WindowCocoa.mm +++ b/intern/ghost/intern/GHOST_WindowCocoa.mm @@ -461,9 +461,13 @@ GHOST_WindowCocoa::GHOST_WindowCocoa( GHOST_WindowCocoa::~GHOST_WindowCocoa() { - if (m_customCursor) delete m_customCursor; - NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; + + if (m_customCursor) { + [m_customCursor release]; + m_customCursor = nil; + } + [m_openGLView release]; if (m_window) { -- cgit v1.2.3