• 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: How to noify the framework when application closes
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to noify the framework when application closes


  • Subject: Re: How to noify the framework when application closes
  • From: Andrew Farmer <email@hidden>
  • Date: Mon, 16 Jan 2006 12:13:10 -0800

On 16 Jan 06, at 01:06, rohit dhamija wrote:
Hi All,
I have build an framework for accessing the usb bulk
storage device using iokit framework. Multiple
applications can access the device using this framework.
For each application accessing the device, the framework
allocates some memory. Now, I need to free this memory
when ever the application:
a. Closes decently
b. Abnornal termination

This *is* a framework in the sense of a bundle containing a library and some headers, right? If it's a separate daemon, skip everything below: if there's some inter- application communication going on, there's probably some sort of socket or pipe connecting the processes, which should notify you when it's closed.

Otherwise:

Are you sure you have to free the memory? Remember that the
entire heap disappears when the application exits, so
there's no point in going through and freeing all the
memory within the heap before then.

The only thing I'm concerned with that you might want to
do in an application like this before terminating would
be to reset the USB devices.

So is there any way that I can notify the framework that
the application has been closed ?

Easy way: require the application to call a method before quitting.

Hard way: register for a notification to be delivered
when the application is terminating.

Neither of these will notify you when the application
"terminates abnormally"; however, there often isn't a lot
you can do in that case, as the heap may have been damaged
by the application in its death throes.

Is giving notification to the framework through signals
the right way ? If yes, then how ?

No. Signals work for inter-application communication only. _______________________________________________ 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
References: 
 >How to noify the framework when application closes (From: rohit dhamija <email@hidden>)

  • Prev by Date: RE: CORE DATA: setImage (transient) and setImageData (binary) accessors don't fire.
  • Next by Date: Re: Q: "Linking" to mail messages?
  • Previous by thread: How to noify the framework when application closes
  • Next by thread: Re: How to noify the framework when application closes
  • Index(es):
    • Date
    • Thread