--- SheepShaver/src/MacOSX/prefs_macosx.mm 2009/08/18 18:22:01 1.2 +++ SheepShaver/src/MacOSX/prefs_macosx.mm 2010/08/22 19:33:25 1.6 @@ -1,5 +1,5 @@ /* - * $Id: prefs_macosx.mm,v 1.2 2009/08/18 18:22:01 asvitkine Exp $ + * $Id: prefs_macosx.mm,v 1.6 2010/08/22 19:33:25 asvitkine Exp $ * * prefs_macosx.mm - Enables access to SheepShaver preferences while * SheepShaver is running (on Mac OS X). @@ -24,12 +24,18 @@ #include "sysdeps.h" +// The _UINT64 define is needed to guard against a typedef mismatch with Snow Leopard headers. +#define _UINT64 + #include #include "VMSettingsController.h" + @interface SheepShaverMain : NSObject +{ NSArray *nibObjects; NSWindow *prefsWindow; +} @end @implementation SheepShaverMain @@ -75,6 +81,8 @@ - (void) openPreferences:(id)sender { + NSAutoreleasePool *pool; + if (nibObjects == nil) { nibObjects = [self loadPrefsNibFile]; if (nibObjects == nil) @@ -82,8 +90,10 @@ [nibObjects retain]; } + pool = [[NSAutoreleasePool alloc] init]; [[VMSettingsController sharedInstance] setupGUI]; [NSApp runModalForWindow:prefsWindow]; + [pool release]; } @end @@ -94,9 +104,12 @@ void prefs_init(void) { + NSAutoreleasePool *pool; NSMenu *appMenu; NSMenuItem *menuItem; + pool = [[NSAutoreleasePool alloc] init]; + appMenu = [[[NSApp mainMenu] itemAtIndex:0] submenu]; menuItem = [[NSMenuItem alloc] initWithTitle:@"Preferences..." action:@selector(openPreferences:) keyEquivalent:@","]; [appMenu insertItem:menuItem atIndex:2]; @@ -104,6 +117,8 @@ void prefs_init(void) [menuItem release]; [NSApp setDelegate:[[SheepShaverMain alloc] init]]; + + [pool release]; }