From ed540dd1f17eb4e8e81068509ffc93933a548aef Mon Sep 17 00:00:00 2001 From: Damien Plisson Date: Tue, 16 Feb 2010 16:38:29 +0000 Subject: [PATCH] Cocoa : mem leak fix This fixes the mem leak part of bug report #21186 --- intern/ghost/intern/GHOST_WindowCocoa.mm | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/intern/ghost/intern/GHOST_WindowCocoa.mm b/intern/ghost/intern/GHOST_WindowCocoa.mm index f9ba8f6e9b9..0b10a02849f 100644 --- a/intern/ghost/intern/GHOST_WindowCocoa.mm +++ b/intern/ghost/intern/GHOST_WindowCocoa.mm @@ -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; }