Cocoa : mem leak fix
[blender-staging.git] / intern / ghost / intern / GHOST_WindowCocoa.mm
index f9ba8f6e9b9172702380011933f85691de4df989..0b10a02849f2e2afad3b4f7838f7a66428ad1c32 100644 (file)
@@ -854,6 +854,8 @@ GHOST_TSuccess GHOST_WindowCocoa::setModifiedState(bool isUnsavedChanges)
 
 GHOST_TSuccess GHOST_WindowCocoa::setOrder(GHOST_TWindowOrder order)
 {
+       NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
+       
        GHOST_ASSERT(getValid(), "GHOST_WindowCocoa::setOrder(): window invalid")
     if (order == GHOST_kWindowOrderTop) {
                [m_window makeKeyAndOrderFront:nil];
@@ -869,6 +871,8 @@ GHOST_TSuccess GHOST_WindowCocoa::setOrder(GHOST_TWindowOrder order)
                        [[windowsList objectAtIndex:0] makeKeyAndOrderFront:nil];
                }
     }
+       
+       [pool drain];
     return GHOST_kSuccess;
 }