• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Mixing cocoa and carbon crashing in photoshop plugin
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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:40:11 -0800

I had one ore question. If the plugin is being unloaded (which i think it is becuase the 2nd time around i can't hit my break points in my code), how can i tell if i am already loaded if my carbon bundle goes away? Do i store a pointer to the bundle in the cocoa plugin? Or will OSX deal with that for me when i call CFBundleLoadExecutable? I am guessing i would just write my Cocoa bundle just like any normal with a few "C" calls for calling into the bundle and an init call (like the docs) that calls NSApplicationLoad.

ok one more question. how can i tell if the bundle is being unloaded?

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
  • Follow-Ups:
    • Re: Mixing cocoa and carbon crashing in photoshop plugin
      • From: Scott Andrew <email@hidden>
References: 
 >Mixing cocoa and carbon crashing in photoshop plugin (From: Scott Andrew <email@hidden>)
 >Re: Mixing cocoa and carbon crashing in photoshop plugin (From: Rosyna <email@hidden>)

  • Prev by Date: Re: Launch older app
  • Next by Date: Removing focus rings from NSImageViews
  • Previous by thread: Re: Mixing cocoa and carbon crashing in photoshop plugin
  • Next by thread: Re: Mixing cocoa and carbon crashing in photoshop plugin
  • Index(es):
    • Date
    • Thread