Freeing resources after software update

Asked by Carl Dixon

I'm using Sparkle for Carbon (although this question may be relevant to Cocoa applications too). My app is full screen, so I show the software update window before taking over the display:

 SUSparkleInitializeForCarbon();
 SUSparkleCheckForUpdates(true);

 EventRef theEvent;
 EventTargetRef theTarget = GetEventDispatcherTarget();

 while( SUSparkleIsUpdateInProgress() && ReceiveNextEvent(0, NULL,kEventDurationForever, true, &theEvent) == noErr )
 {
  SendEventToEventTarget (theEvent, theTarget);
  ReleaseEvent(theEvent);
 }

 RunFullScreenApplication();

The problem is that I can't find a way to clean up Sparkle when it is finished. It would be nice if there were a function called SUSparkleExitForCarbon(). As it stands, there are 9 additional threads (which look to be mostly networking and WebKit related), and 10MB of unfreed memory remaining after the software update has completed.

Would it be possible to only allocate resources while an update is being performed if SUEnableAutomaticChecks is set to false?

Apologies if I've missed something obvious, and thanks for such a great piece of software.
Carl.

Question information

Language:
English Edit question
Status:
Solved
For:
Sparkle Edit question
Assignee:
No assignee Edit question
Solved by:
Carl Dixon
Solved:
Last query:
Last reply:
Revision history for this message
Andy Matuschak (andymatuschak) said :
#1

Hm. Unfortunately, Sparkle really isn’t designed to be used like this: the main updater class is a singleton (for easy deployment in IB), so it’s always going to take up a little memory. Though 10 MB sounds like kind of a lot.

As far as the extra threads (wow!), those are something WebKit and NSURLDownload spin up. We free all the WebViews once we’re done showing the release notes, but I guess the threads stay around?

Sorry for the lack of nice tuning here.

Revision history for this message
Carl Dixon (carldixon) said :
#2

No problem, the OS will probably page it out to disk when it isn't being used anyway. If it becomes an issue then the software update can always be put in a separate launcher executable. Thanks for the reply!