• 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: Carbon app and Cocoa/Carbon Bundle plugin - possible?!
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Carbon app and Cocoa/Carbon Bundle plugin - possible?!


  • Subject: Re: Carbon app and Cocoa/Carbon Bundle plugin - possible?!
  • From: Chris Hanson <email@hidden>
  • Date: Wed, 19 Jun 2013 16:31:27 -0700

Releasing the CFBundle just releases the object representing the loadable code, it doesn’t actually unload the code from the process. So you may have thought you were unloading plug-ins with CFRelease, but you actually weren’t...

  -- Chris

On Jun 19, 2013, at 2:29 AM, Igor Delovski <email@hidden> wrote:

> Thanks for the info,
>
> So it seems I was lucky so far, even though I didn&#39;t even know
> CFBundleUnloadExecutable() existed, I was unloading things with
> the simple CFRelease().
>
> I use these plugins for custom printing and custom imports/exports.
> Now I need to talk to a web service and use JSON and I have no idea
> how to do it in Carbon so I need Cocoa for that.
>
> My whole plugin system originated on OS9 (and OS7, 8) where I
> couldn&#39;t do much in there since global variables were not allowed.
> Couldn&#39;t even link to libraries because most of them used at least
> a few.
>
> Thats&#39;s why I exposed everything from the main application to the
> plugin via function pointers. Even strcpy(), printf(), everything from
> the Mac Toolbox and my own stuff that I needed in plugin.
>
> My main app had somewhere initialization like this:
>
> pinData-&gt;sys-&gt;p_strcpy = strcpy;
> ...
> pinData-&gt;app-&gt;p_drawPic = id_drawPic;
>
> and in my plugin I had defines like these:
>
> #define  strcpy  pinSys-&gt;p_strcpy
> #define  id_drawPic  pinApp-&gt;p_drawPic
>
> This way plugins could do almost anything. At some point I moved
> it all to Windows and DLLs and later to OSX. The code in
> plugins looked normal, portable, copy/pastable from the main app
> to plugin and back, but it was all preprocessed into something
> else.
>
> Maybe that is why I could get away with unloading plugins as they
> never really used the os directly. Now, I must admit that at several
> occasions it seemed as if the latest version is not being used as
> I replaced the older.
>
> Four or five years ago, I was at one of my clients, I was making
> changes in the code on my MacBook and moving resulting plugin
> over the network directly to his computer where it was being
> used, but at some point we realized that the same old version
> is executed. The client restarted the application on his Mac and
> then the latest version kicked in.
>
> I was on Leopard, he was on Tiger so we thought maybe the Tiger
> was the problem.
>
> Anyway, thanks for your remarks.
>
> Igor
>
>
>
> --- On Wed, 6/19/13, Chris Hanson  wrote:
>
> &gt; From: Chris Hanson
> &gt; Subject: Re: Carbon app and Cocoa/Carbon Bundle plugin - possible?!
> &gt; To: &quot;Igor Delovski&quot;
> &gt; Cc: &quot;Jon Gotow&quot; , &quot;email@hidden&quot;
> &gt; Date: Wednesday, June 19, 2013, 3:10 AM
> &gt; On Jun 18, 2013, at 12:51 PM, Igor
> &gt; Delovski
> &gt; wrote:
> &gt;
> &gt; &gt; At first glance this seems to be the case. Just put
> &gt; into comments this part: CFRelease (bundleRef); and
> &gt; application stopped crashing. Now I have to reorganize
> &gt; everything, plugins need to tell the application if they
> &gt; need to stay alive forever.
> &gt;
> &gt; You can’t really safely unload any of your plug-ins, even
> &gt; if they don’t use Cocoa directly, because subsystems they
> &gt; rely upon (for example, other OS-level frameworks) may use
> &gt; Cocoa.
> &gt;
> &gt; Virtually all developers should treat
> &gt; CFBundleUnloadExecutable, -[NSBundle unload], and dlclose(3)
> &gt; as if they’re unavailable.
> &gt;
> &gt;   -- Chris
> &gt;
> &gt;
>
> _______________________________________________
> Do not post admin requests to the list. They will be ignored.
> Xcode-users mailing list      (email@hidden)
> Help/Unsubscribe/Update your Subscription:
>
> This email sent to email@hidden


 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden


References: 
 >Re: Carbon app and Cocoa/Carbon Bundle plugin - possible?! (From: Igor Delovski <email@hidden>)

  • Prev by Date: Re: Do I need to codesign my .app, or just the installer?
  • Next by Date: Re: Jumping to Lines
  • Previous by thread: Re: Carbon app and Cocoa/Carbon Bundle plugin - possible?!
  • Next by thread: Enterprise dist app stuck in download, can't delete or re-download
  • Index(es):
    • Date
    • Thread