Re: Mixing cocoa and carbon crashing in photoshop plugin
Re: Mixing cocoa and carbon crashing in photoshop plugin
- Subject: Re: Mixing cocoa and carbon crashing in photoshop plugin
- From: Scott Andrew <email@hidden>
- Date: Thu, 24 Nov 2005 08:30:56 -0800
So basically what i am thinking is that i move a bulk of my plug-in
to a cocoa bundle and use CFBundleLoad to load it and get pointers to
an allocate plugin call when AllocatePlugin is called by photoshop.
So my next question gets to be my 2nd one on the list (i am mixing C+
+ here with objective C and there are times when the calls (like for
callbacks) bounce between C++ and Objective C and I pass need to pass
an objective C object as a void* (should be ok i imagine). So if i
create a function in my bundle like so, exported of course, to create
a C++ object:
Foo* CreateFoo();
then can i do something like?
#include "Foo.h"
foo->bar();
delete foo(); (ok i know the delete is bad)
or do i need to export the Foo class from the bundle?
Scott Andrew
On Nov 24, 2005, at 6:22 AM, Rosyna wrote:
Is photoshop unloading your plugin?
According to the documentation, "NSBundle correctly loads Objective-
C symbols into the runtime system, but there is no way to unload
Cocoa bundles once loaded due to a runtime limitation."
I actually do everything dynamically. Load the objective-c runtime,
then use objc_msgSend() to call all the things I need. Or call
something that I know will load cocoa for me like
FCCopyCollectionNames() (although I have no idea why this loads
Cocoa on 10,4, it shouldn't since the API it is using doesn't
require Cocoa for anything, but oh well).
Some others just have a cocoa bundle that they load from their
carbon bundle with no ill affects. I do that as well, however my
cocoa bundle only contains a category (too lazy to register a
category on a class dynamically).
Ack, at 11/24/05, Scott Andrew said:
I have a photoshop plug-in that i am mixing cocoa and carbon in
and i am getting intermittent crashes. I do call NSApplicationLoad
like i should. The 2nd time i come through the app i don't hit my
break points. Now i saw something about bundles with coco never
unloading so I am thinking this could be the solution.
So my thought was to create a cocoa bundle that is loaded by my
Carbon bundle. I want to use cocoa for the UI. I was wondering if
checking CFBoundleIsLoaded would be a check i should make and
don't reload the plugin the 2nd time around if tis loaded. Has
anyone mixed carbon/cocoa in a plugin? Did you seperate the cocoa
into a seperate bundle or code?
--
Sincerely,
Rosyna Keller
Technical Support/Holy Knight/Always needs a hug
Unsanity: Unsane Tools for Insanely Great People
It's either this, or imagining Phil Schiller in a thong.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden