Skip to content

Commit

Permalink
make sure an autoreleasepool is in place
Browse files Browse the repository at this point in the history
  • Loading branch information
mdehoon committed Nov 14, 2015
1 parent 5ac32f3 commit 1443515
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/_macosx.m
Expand Up @@ -6264,8 +6264,10 @@ static void timer_callback(CFRunLoopTimerRef timer, void* info)
static bool verify_framework(void)
{
#ifdef COMPILING_FOR_10_6
NSAutoreleasePool* pool = [[NSAutoreleasePool alloc] init];
NSRunningApplication* app = [NSRunningApplication currentApplication];
NSApplicationActivationPolicy activationPolicy = [app activationPolicy];
[pool release];
switch (activationPolicy) {
case NSApplicationActivationPolicyRegular:
case NSApplicationActivationPolicyAccessory:
Expand Down Expand Up @@ -6380,13 +6382,15 @@ void init_macosx(void)

PyOS_InputHook = wait_for_stdin;

NSAutoreleasePool* pool = [[NSAutoreleasePool alloc] init];
WindowServerConnectionManager* connectionManager = [WindowServerConnectionManager sharedManager];
NSWorkspace* workspace = [NSWorkspace sharedWorkspace];
NSNotificationCenter* notificationCenter = [workspace notificationCenter];
[notificationCenter addObserver: connectionManager
selector: @selector(launch:)
name: NSWorkspaceDidLaunchApplicationNotification
object: nil];
[pool release];
#if PY3K
return module;
#endif
Expand Down

0 comments on commit 1443515

Please sign in to comment.