Skip to content

EXC_BAD_ACCESS on currentWindow w/ latest openFrameworks (due to be 0.90) #7

Description

@pkmital

Hi Will,

I'd really love to use this in some projects I'm working on with the latest openFrameworks (due to be 0.90). I am not too familiar with how they've changed things but it definitely breaks ofxnswindower. Here is a back trace:

(lldb) bt
* thread #1: tid = 0xdfc69, 0x00000001004d4f6e Audio BrowserDebug`ofMainLoop::getCurrentWindow() [inlined] std::tr1::__shared_ptr<ofAppBaseWindow, (__gnu_cxx::_Lock_policy)2>::__shared_ptr(std::tr1::__shared_ptr<ofAppBaseWindow, (__gnu_cxx::_Lock_policy)2> const&) at boost_shared_ptr.h:503, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=1, address=0xc0)
    frame #0: 0x00000001004d4f6e Audio BrowserDebug`ofMainLoop::getCurrentWindow() [inlined] std::tr1::__shared_ptr<ofAppBaseWindow, (__gnu_cxx::_Lock_policy)2>::__shared_ptr(std::tr1::__shared_ptr<ofAppBaseWindow, (__gnu_cxx::_Lock_policy)2> const&) at boost_shared_ptr.h:503
    frame #1: 0x00000001004d4f6e Audio BrowserDebug`ofMainLoop::getCurrentWindow() [inlined] std::tr1::shared_ptr<ofAppBaseWindow>::shared_ptr(this=0x00007fff5fbfdfe8) at boost_shared_ptr.h:972
    frame #2: 0x00000001004d4f6e Audio BrowserDebug`ofMainLoop::getCurrentWindow() [inlined] std::tr1::shared_ptr<ofAppBaseWindow>::shared_ptr(this=0x00007fff5fbfdfe8) at boost_shared_ptr.h:972
  * frame #3: 0x00000001004d4f6e Audio BrowserDebug`ofMainLoop::getCurrentWindow(this=0x0000000000000000) + 4 at ofMainLoop.cpp:132
    frame #4: 0x00000001004b1fea Audio BrowserDebug`ofGetCurrentRenderer() + 25 at ofAppRunner.cpp:215
    frame #5: 0x00000001004d5f8f Audio BrowserDebug`ofSetCurrentRenderer(renderer=shared_ptr<ofBaseRenderer> at 0x00007fff5fbfe0c8, setDefaults=<unavailable>) + 75 at ofGraphics.cpp:26
    frame #6: 0x0000000100098e76 Audio BrowserDebug`-[OpenGLContext init](self=0x0000608000036c80, _cmd=0x00007fff89d7b774) + 566 at OpenGLContext.mm:63
    frame #7: 0x0000000100098fb6 Audio BrowserDebug`+[OpenGLContext instance](self=0x0000000100796678, _cmd=0x00007fff8a506d19) + 70 at OpenGLContext.mm:83
    frame #8: 0x000000010001526f Audio BrowserDebug`ofxNSWindower::ofxNSWindower(this=0x000060800004b520) + 47 at ofxNSWindower.mm:25
    frame #9: 0x0000000100015235 Audio BrowserDebug`ofxNSWindower::ofxNSWindower(this=0x000060800004b520) + 21 at ofxNSWindower.mm:31
    frame #10: 0x00000001000151db Audio BrowserDebug`ofxNSWindower::instance() + 59 at ofxNSWindower.mm:16
    frame #11: 0x0000000100052016 Audio BrowserDebug`-[AppDelegate loadStudy:](self=0x0000608000113cb0, _cmd=0x000000010067057e, sender=0x00006080000ad3e0) + 166 at AppDelegate.mm:124
    frame #12: 0x00007fff8956d260 AppKit`-[NSApplication sendAction:to:from:] + 327
    frame #13: 0x00007fff895881c8 AppKit`-[NSMenuItem _corePerformAction] + 394
    frame #14: 0x00007fff89587f04 AppKit`-[NSCarbonMenuImpl performActionWithHighlightingForItemAtIndex:] + 117
    frame #15: 0x00007fff895d740d AppKit`-[NSMenu _internalPerformActionForItemAtIndex:] + 35
    frame #16: 0x00007fff895d7289 AppKit`-[NSCarbonMenuImpl _carbonCommandProcessEvent:handlerCallRef:] + 104
    frame #17: 0x00007fff8957dff6 AppKit`NSSLMMenuEventHandler + 716
    frame #18: 0x00007fff8c5091d4 HIToolbox`DispatchEventToHandlers(EventTargetRec*, OpaqueEventRef*, HandlerCallRec*) + 892
    frame #19: 0x00007fff8c508787 HIToolbox`SendEventToEventTargetInternal(OpaqueEventRef*, OpaqueEventTargetRef*, HandlerCallRec*) + 385
    frame #20: 0x00007fff8c51c880 HIToolbox`SendEventToEventTarget + 40
    frame #21: 0x00007fff8c552640 HIToolbox`SendHICommandEvent(unsigned int, HICommand const*, unsigned int, unsigned int, unsigned char, void const*, OpaqueEventTargetRef*, OpaqueEventTargetRef*, OpaqueEventRef**) + 420
    frame #22: 0x00007fff8c585228 HIToolbox`SendMenuCommandWithContextAndModifiers + 59
    frame #23: 0x00007fff8c5851d0 HIToolbox`SendMenuItemSelectedEvent + 178
    frame #24: 0x00007fff8c5850af HIToolbox`FinishMenuSelection(SelectionData*, MenuResult*, MenuResult*) + 94
    frame #25: 0x00007fff8c58d085 HIToolbox`MenuSelectCore(MenuData*, Point, double, unsigned int, OpaqueMenuRef**, unsigned short*) + 718
    frame #26: 0x00007fff8c58ccb1 HIToolbox`_HandleMenuSelection2 + 446
    frame #27: 0x00007fff894f062c AppKit`_NSHandleCarbonMenuEvent + 284
    frame #28: 0x00007fff8934f52e AppKit`_DPSNextEvent + 2170
    frame #29: 0x00007fff8934e89b AppKit`-[NSApplication nextEventMatchingMask:untilDate:inMode:dequeue:] + 122
    frame #30: 0x00007fff8934299c AppKit`-[NSApplication run] + 553
    frame #31: 0x00007fff8932d783 AppKit`NSApplicationMain + 940
    frame #32: 0x0000000100093f72 Audio BrowserDebug`main(argc=3, argv=0x00007fff5fbff7e8) + 34 at main.mm:81
    frame #33: 0x0000000100002434 Audio BrowserDebug`start + 52
(lldb) 

I also had to add some virtual methods that were not included in ofxNSWindow. I don't know if that is the right approach though. Any ideas really appreciated!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions