From: Alexei S. <ale...@gm...> - 2010-01-02 22:10:08
|
Committed. Thanks. -Alexei On Sat, Jan 2, 2010 at 4:18 PM, Tim Douglas <ti...@gm...> wrote: > Hey Alexei, > Thanks for the commit, but the error messages appear to come from > prefs_init(), not openPreferences: > (gdb) break _NSAutoreleaseNoPool > Breakpoint 1 at 0xa24af16 > (gdb) run --frameskip 0 --ramsize 268435456 --ignoresegv true > --ignoreillegal true --ether slirp --idlewait true --keycodes true > --keycodefile keycodes --frameskip 0 --rom Mac\ OS\ ROM --disk > harddrive9.img > Starting program: /Users/timdoug/Desktop/ss/SheepShaver/src/Unix/SheepShaver > --frameskip 0 --ramsize 268435456 --ignoresegv true --ignoreillegal true > --ether slirp --idlewait true --keycodes true --keycodefile keycodes > --frameskip 0 --rom Mac\ OS\ ROM --disk harddrive9.img > Reading symbols for shared libraries > +++++++++++++++++.......................................................................... > done > Breakpoint 1 at 0x92b65f16 > SheepShaver V2.3 by Christian Bauer and Mar"c" Hellwig > Breakpoint 1, 0x92b65f16 in _NSAutoreleaseNoPool () > (gdb) bt > #0 0x92b65f16 in _NSAutoreleaseNoPool () > #1 0x92a73637 in +[NSPathStore2 pathStoreWithCharacters:length:] () > #2 0x92a7feb7 in -[NSString(NSPathUtilities) stringByDeletingPathExtension] > () > #3 0x957c7fa3 in +[NSImage imageNamed:] () > #4 0x957f2e6d in -[NSMenuItem initWithTitle:action:keyEquivalent:] () > #5 0x78072352 in prefs_init () at ../MacOSX/prefs_macosx.mm:105 > #6 0x7804a29f in main (argc=1, argv=0xbffff5c4) at main_unix.cpp:485 > (gdb) ... > The following seven breakpoints are also triggered in prefs_init(). Moving > the allocation and deallocation to that function from openPreferences > appears to fix 'em (see attached). > Thanks, > -Tim > On Sat, Jan 2, 2010 at 2:26 PM, Alexei Svitkine <ale...@gm...> > wrote: >> >> Hi Tim, >> >> I've committed a change that creates and releases the pool around the >> call to the modal prefs dialog only. Can you verify that this gets rid >> of the messages? >> >> -Alexei >> >> On Sat, Jan 2, 2010 at 4:27 AM, Christian Bauer <cb...@ce...> wrote: >> > I'm no Objective C or Cocoa master either... :) >> > >> > -------- Original Message -------- >> > Subject: [PATCH] SheepShaver, Mac OS X, and NSAutoreleasePool >> > Date: Fri, 1 Jan 2010 16:07:45 -0500 >> > From: Tim Douglas <ti...@gm...> >> > To: cb...@ce... >> > >> > Mr. Bauer, >> > >> > Thanks so much for the development of SheepShaver. It's wonderful >> > reliving >> > memories of Mac OSs past on my shiny Core 2 MacBook Pro. When compiling >> > the >> > source from CVS and running it on Mac OS X 10.5.8, I receive these >> > messages >> > on stderr: >> > >> > 2010-01-01 16:02:08.421 SheepShaver[11638:10b] *** >> > _NSAutoreleaseNoPool(): >> > Object 0x30d800 of class NSPathStore2 autoreleased with no pool in place >> > - >> > just leaking >> > Stack: (0x92b65f4f 0x92a73637 0x92a7feb7 0x957c7fa3 0x957f2e6d >> > 0x78072372 >> > 0x7804a29f 0x78049066) >> > 2010-01-01 16:02:08.423 SheepShaver[11638:10b] *** >> > _NSAutoreleaseNoPool(): >> > Object 0x314490 of class NSCFData autoreleased with no pool in place - >> > just >> > leaking >> > Stack: (0x92b65f4f 0x92a72432 0x92a86b25 0x92a86701 0x957c8280 >> > 0x957c8161 >> > 0x957c7fdf 0x957f2e6d 0x78072372 0x7804a29f 0x78049066) >> > 2010-01-01 16:02:08.430 SheepShaver[11638:10b] *** >> > _NSAutoreleaseNoPool(): >> > Object 0xa08a0fa0 of class NSCFString autoreleased with no pool in place >> > - >> > just leaking >> > Stack: (0x92b65f4f 0x92a72432 0x957c8161 0x957c7fdf 0x957f2e6d >> > 0x78072372 >> > 0x7804a29f 0x78049066) >> > >> > ...and five more similar ones. It appears as if Cocoa APIs are being >> > used >> > without an NSAutoreleasePool in place. The attached CVS diff appears to >> > fix >> > the issue by establishing the appropriate pool before the calls are >> > made. I'm no Objective C or Cocoa master, nor do I have that strong of a >> > grasp of the internal workings of SheepShaver, but presumably something >> > along these lines is all that's needed. >> > >> > Thanks again for the great emulator! >> > -Tim >> > >> > ---------cut here--------- >> > >> > Index: src/MacOSX/prefs_macosx.mm >> > =================================================================== >> > RCS file: /home/cvs/cebix/SheepShaver/src/MacOSX/prefs_macosx.mm,v >> > retrieving revision 1.2 >> > diff -u -r1.2 prefs_macosx.mm >> > --- src/MacOSX/prefs_macosx.mm 18 Aug 2009 18:22:01 -0000 1.2 >> > +++ src/MacOSX/prefs_macosx.mm 1 Jan 2010 20:56:08 -0000 >> > @@ -30,6 +30,7 @@ >> > @interface SheepShaverMain : NSObject >> > NSArray *nibObjects; >> > NSWindow *prefsWindow; >> > + NSAutoreleasePool *pool; >> > @end >> > >> > @implementation SheepShaverMain >> > @@ -97,6 +98,7 @@ >> > 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]; >> > @@ -113,4 +115,5 @@ >> > >> > void prefs_exit(void) >> > { >> > + [pool release]; >> > } >> > >> > >> > >> > ------------------------------------------------------------------------------ >> > This SF.Net email is sponsored by the Verizon Developer Community >> > Take advantage of Verizon's best-in-class app development support >> > A streamlined, 14 day to market process makes app distribution fast and >> > easy >> > Join now and get one step closer to millions of Verizon customers >> > http://p.sf.net/sfu/verizon-dev2dev >> > _______________________________________________ >> > basilisk-devel mailing list >> > bas...@li... >> > https://lists.sourceforge.net/lists/listinfo/basilisk-devel >> > >> > > > |