Terminating app when threads are running
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.