Carbon NavServices dialogs in Cocoa apps
Carbon NavServices dialogs in Cocoa apps
- Subject: Carbon NavServices dialogs in Cocoa apps
- From: Marc Poirier <email@hidden>
- Date: Sun, 20 Jun 2004 17:41:00 -0400 (EDT)
This isn't a CoreAudio thing, though it's something that I think affects
many AU host or plugin developers (that's why it's coming up for me), so
I'm thinking that probably someone here can help...
Basically, in the AU Turntablist, I am using NavCreateGetFileDialog() and
then NavCreateGetFileDialog() to create a file open dialog (with no
modality, I don't know if that makes a difference). And then in my
NavEventProc, I handle the kNavCBTerminate selector by doing
NavDialogDispose(inCallbackParams->context) to dispose of the dialog.
This is, from what documentation and Apple example code I've seen,
correct. But it causes crashes in Cocoa hosts such as Rax and SynthTest.
It does not crash GarageBand, though, and does not crash Carbon apps.
When I remove the call to DavDialogDispose(), the crashes don't occur,
though then I leak memory, so I'm not very satisfied with that workaround.
I was wondering if maybe this has something to do with mixing Carbon
windows or dialogs in a Cocoa app? Is there maybe something that I have
to do in order to make sure that this works well, or that the Cocoa host
has to do in order to prepare the environment for Carbon NavServices
dialogs? Did anyone who worked on GarageBand know if they had to
something special to make this work okay?
Interestingly, the crash traces are literally exactly the same for both
Rax and SynthTest, even down to the address of the bad memory access,
which is so interesting that I thought I might as well include an excerpt:
Exception: EXC_BAD_ACCESS (0x0001)
Codes: KERN_INVALID_ADDRESS (0x0001) at 0xa1b1c1d7
Thread 0 Crashed:
0 com.apple.HIToolbox 0x92b042e4 0x927d0000 + 0x3342e4
1 com.apple.HIToolbox 0x928fbe14 TBrowserView::TrackMouse(short&, Point, long, unsigned short) + 0x470
2 com.apple.HIToolbox 0x928fb990 TListView::TrackMouse(short&, Point, long, unsigned short) + 0x4d8
3 com.apple.HIToolbox 0x928fa2fc TBrowserView::Track(Point, long, unsigned short) + 0x150
4 com.apple.HIToolbox 0x928fa180 TBrowser::Track(Point, long, unsigned short) + 0x38
5 com.apple.HIToolbox 0x928053ec HLTB_CDEF::EntryPoint(short, OpaqueControlRef*, short, long) + 0x3c4
6 com.apple.HIToolbox 0x9282ffd8 DataBrowserCDEF(short, OpaqueControlRef*, short, long) + 0x6c
7 com.apple.HIToolbox 0x927df46c DispatchMessage(ClassicCDEFAdapter*, short, long, unsigned char, unsigned char) + 0xb0
8 com.apple.HIToolbox 0x928fa110 Track(ClassicCDEFAdapter*, OpaqueEventRef*) + 0xd4
9 com.apple.HIToolbox 0x927e1794 ClassicCDEFAdapter::EventHandler(OpaqueEventHandlerCallRef*, OpaqueEventRef*, void*) + 0x2d0
10 com.apple.HIToolbox 0x927d2330 DispatchEventToHandlers + 0x150
11 com.apple.HIToolbox 0x927d25a4 SendEventToEventTargetInternal + 0x174
12 com.apple.HIToolbox 0x927d6a0c SendEventToEventTargetWithOptions + 0x28
13 com.apple.HIToolbox 0x9286fec4 SendControlDefTrack(HIView*, CGPoint const&, unsigned long*, void (*)(OpaqueControlRef*, short), short*) + 0xdc
14 com.apple.HIToolbox 0x928957f4 HIView::ClickInternal(CGPoint const&, unsigned long, void (*)(OpaqueControlRef*, short), bool) + 0x5c
15 com.apple.HIToolbox 0x9289b514 HIView::ClickSelf(OpaqueEventRef*) + 0x124
16 com.apple.HIToolbox 0x927d5cbc HIView::EventHandler(OpaqueEventHandlerCallRef*, OpaqueEventRef*, void*) + 0x1814
17 com.apple.HIToolbox 0x927d2330 DispatchEventToHandlers + 0x150
18 com.apple.HIToolbox 0x927d25a4 SendEventToEventTargetInternal + 0x174
19 com.apple.HIToolbox 0x927e4a34 SendEventToEventTarget + 0x28
20 com.apple.HIToolbox 0x9289b2c8 HIView::Click(OpaqueEventRef*) + 0x10c
21 com.apple.HIToolbox 0x928e983c HIViewClick + 0x38
22 com.apple.HIToolbox 0x928b6f28 HandleClickAsHIView + 0x9c
23 com.apple.HIToolbox 0x928f4f88 HandleClickInContent + 0x150
24 com.apple.HIToolbox 0x92800680 HandleWindowEvent + 0x638
25 com.apple.HIToolbox 0x92828074 StandardWindowEventHandler + 0xb4
26 com.apple.HIToolbox 0x927d2330 DispatchEventToHandlers + 0x150
27 com.apple.HIToolbox 0x927d25a4 SendEventToEventTargetInternal + 0x174
28 com.apple.HIToolbox 0x927e4a34 SendEventToEventTarget + 0x28
29 com.apple.AppKit 0x92f88524 SendEventFromMouseDown + 0x284
30 com.apple.AppKit 0x92f88230 -[NSCarbonWindow handleMouseDownEvent:at:inPart:withMods:] + 0x3d4
31 com.apple.AppKit 0x92f87c08 NSCarbonWindowHandleEvent + 0xd0
32 com.apple.HIToolbox 0x927d2330 DispatchEventToHandlers + 0x150
33 com.apple.HIToolbox 0x927d25a4 SendEventToEventTargetInternal + 0x174
34 com.apple.HIToolbox 0x927e4a34 SendEventToEventTarget + 0x28
35 com.apple.HIToolbox 0x927f31b4 HandleMouseEventForWindow(OpaqueWindowPtr*, OpaqueEventRef*, unsigned short) + 0x144
36 com.apple.HIToolbox 0x927e8ad0 HandleMouseEvent(OpaqueEventRef*) + 0x170
37 com.apple.HIToolbox 0x927e2fd4 ToolboxEventDispatcherHandler(OpaqueEventHandlerCallRef*, OpaqueEventRef*, void*) + 0x1e8
38 com.apple.HIToolbox 0x927d23ec DispatchEventToHandlers + 0x20c
39 com.apple.HIToolbox 0x927d25a4 SendEventToEventTargetInternal + 0x174
40 com.apple.HIToolbox 0x927e4a34 SendEventToEventTarget + 0x28
41 com.apple.AppKit 0x92f87db4 -[NSCarbonWindow sendEvent:] + 0x84
42 com.apple.AppKit 0x92df5324 -[NSApplication sendEvent:] + 0xebc
43 com.apple.AppKit 0x92dfd73c -[NSApplication run] + 0x240
44 com.apple.AppKit 0x92eb9b80 NSApplicationMain + 0x1d0
45 com.grantedsw.rax 0x00002cf8 _start + 0x188 (crt.c:267)
46 dyld 0x8fe1a558 _dyld_start + 0x64
_______________________________________________
coreaudio-api mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/coreaudio-api
Do not post admin requests to the list. They will be ignored.