• 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
Terminating app when threads are running
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Terminating app when threads are running


  • Subject: Terminating app when threads are running
  • From: Charles Srstka <email@hidden>
  • Date: Wed, 13 Mar 2002 02:21:40 -0600

Okay, this is frustrating.

I have an app that will sometimes spawn threads. If I try to quit the
app while the worker threads are working, nothing happens. I thought it
would be nice to put up a dialog that says something like "We're busy
right now. Are you sure you want to quit and abort what's going on?" and
then, if the user gives the OK, kill the worker threads and quit. I
tried to do this by having the NSApp's delegate respond to the
applicationShouldTerminate: method, but that method never gets called if
the worker threads are going. If the worker threads aren't going, it
gets called just fine. I also tried overriding the document's
canCloseDocument method, and that didn't get called even when a worker
thread wasn't running.

So, what's the correct way to do this? Please tell me I don't have to
subclass NSApplication.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

  • Prev by Date: mouse drag feedback
  • Next by Date: Re: Loading a localized tiff file: how to?
  • Previous by thread: Re: mouse drag feedback
  • Next by thread: Setting the width of an NSTextView automatically
  • Index(es):
    • Date
    • Thread