mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
bug 559075 - add local autorelease pool to SetupMacApplicationDelegate to prevent startup leakage. r=josh
This commit is contained in:
parent
9448cba17e
commit
6c0909b348
@ -92,6 +92,10 @@ SetupMacApplicationDelegate()
|
|||||||
{
|
{
|
||||||
NS_OBJC_BEGIN_TRY_ABORT_BLOCK;
|
NS_OBJC_BEGIN_TRY_ABORT_BLOCK;
|
||||||
|
|
||||||
|
// this is called during startup, outside an event loop, and therefore
|
||||||
|
// needs an autorelease pool to avoid cocoa object leakage (bug 559075)
|
||||||
|
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
|
||||||
|
|
||||||
// This call makes it so that application:openFile: doesn't get bogus calls
|
// This call makes it so that application:openFile: doesn't get bogus calls
|
||||||
// from Cocoa doing its own parsing of the argument string. And yes, we need
|
// from Cocoa doing its own parsing of the argument string. And yes, we need
|
||||||
// to use a string with a boolean value in it. That's just how it works.
|
// to use a string with a boolean value in it. That's just how it works.
|
||||||
@ -102,6 +106,8 @@ SetupMacApplicationDelegate()
|
|||||||
MacApplicationDelegate *delegate = [[MacApplicationDelegate alloc] init];
|
MacApplicationDelegate *delegate = [[MacApplicationDelegate alloc] init];
|
||||||
[[NSApplication sharedApplication] setDelegate:delegate];
|
[[NSApplication sharedApplication] setDelegate:delegate];
|
||||||
|
|
||||||
|
[pool release];
|
||||||
|
|
||||||
NS_OBJC_END_TRY_ABORT_BLOCK;
|
NS_OBJC_END_TRY_ABORT_BLOCK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user