Cocoa : mem leak fix
authorDamien Plisson <damien.plisson@yahoo.fr>
Tue, 16 Feb 2010 16:38:29 +0000 (16:38 +0000)
committerDamien Plisson <damien.plisson@yahoo.fr>
Tue, 16 Feb 2010 16:38:29 +0000 (16:38 +0000)
This fixes the mem leak part of bug report #21186

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;
 }