Re: Photoshop plugin with Cocoa UI problems
Re: Photoshop plugin with Cocoa UI problems
- Subject: Re: Photoshop plugin with Cocoa UI problems
- From: Frederik Slijkerman <email@hidden>
- Date: Thu, 11 Jun 2009 18:32:51 +0200
Hi Florian,
I just tried this and oddly enough, when I show the window like this and
call [NSApp run] to start the event loop, the crash doesn't seem to
occur. Can't say 100% sure yet, because it doesn't happen all the time,
but it hasn't happened yet, while I can easily get the crash using a
modal window. So, it looks like this could be the solution. Thanks!
Best regards,
Frederik Slijkerman
Florian Soenens wrote:
Hi Frederik,
Have you tried wiring your window to an IBOutlet of your Controller and
displaying it with [window makeKeyAndOrderFront:nil]; ?
This works for me anyway.
HTH,
Florian.
On 10 Jun 2009, at 16:07, Frederik Slijkerman wrote:
Hi all,
I'm trying to make a Photoshop plugin with a Cocoa user interface, but
I'm running into a persistent problem: after closing the plugin
window, Photoshop crashes 90% of the time with the following call stack:
#0 0xa04590d8 in _XHNDL_trapback_instruction
#1 0xbf800fac in ??
#2 0x917ea9a2 in __CFRunLoopDoObservers
#3 0x917ebcfc in CFRunLoopRunSpecific
#4 0x917eccd8 in CFRunLoopRunInMode
#5 0x969f42c0 in RunCurrentEventLoopInMode
#6 0x96aa7904 in GetNextEventMatchingMask
#7 0x96aa7766 in WNEInternal
#8 0x96aa76c5 in WaitNextEvent
I've tried every suggestion I could find. The main plugin is a Carbon
bundle that locates the Cocoa bundle that actually contains the core
plugin as suggested here:
http://furbo.org/2008/07/08/plug-ins-the-cocoa-way/
The Cocoa bundle exports a plugin entry point as a C function. The
Carbon bundle calls this from its own entry point using CFBundleCreate
/ CFBundleGetFunctionPointerForName, but it never releases the Cocoa
bundle since apparently Cocoa bundles should not be unloaded. The
whole idea behind this, as far as I can see, is that Photoshop unloads
the Carbon bundle, but does not unload the core Cocoa bundle.
Next, the Cocoa bundle calls NSApplicationLoad, displays an empty
window using [NSApp runModalForWindow], then closes the window and
returns. At this point, I get the aforementioned crash.
What am I doing wrong? Any pointers would be highly appreciated --
I've been staring at this for about three days now...
Best regards,
Frederik Slijkerman
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden