[Pyobjc-dev] Confusing crash that's fixed by adding NSBeep()
Brought to you by:
ronaldoussoren
From: Scott H. <sco...@gm...> - 2010-05-14 06:41:03
|
I've got this obj-c object in a simple demo program: @implementation junker -(id) init { [super init]; NSLog(@"initing"); [self action]; return self; } -(void) action { NSLog(@"junk"); //NSBeep(); } @end I call it from Python in my App delegate like this: from Foundation import * from AppKit import * class PyObjCTestAppDelegate(NSObject): def applicationDidFinishLaunching_(self, sender): NSLog("Application did finish launching.") self.a=junker.alloc().init() def awakeFromNib(self): NSLog("Awoke from NIB") @objc.IBAction def buttonPress_(self, sender): NSLog("Button pressed!") self.a.action() The funny thing is that the program crashes when I press the button that calls buttonPress iff NSBeep is commented out, but runs fine if the NSBeep is uncommented. Strange. Here's the console output: 2010-05-14 00:39:23.924 PyObjCTest[99096:a0f] Awoke from NIB 2010-05-14 00:39:24.006 PyObjCTest[99096:a0f] Drawing 2010-05-14 00:39:24.069 PyObjCTest[99096:a0f] Application did finish launching. 2010-05-14 00:39:24.070 PyObjCTest[99096:a0f] initing 2010-05-14 00:39:24.070 PyObjCTest[99096:a0f] junk 2010-05-14 00:39:29.781 PyObjCTest[99096:a0f] Button Pressed 2010-05-14 00:39:29.782 PyObjCTest[99096:a0f] junk Program received signal: “EXC_BAD_ACCESS”. sharedlibrary apply-load-rules all Any ideas? Thanks, -Scott |