A graceful termination of the application, either in response to some input or by internal logic. Usually applied for applications that need to run certain code in order to terminate in consistent way.
Questions tagged [application-shutdown]
170 questions
1
vote
0 answers
How do I destroy a Unity Networking Match when app is shutting down?
I've got a ResetNetworkManager method that's called when the server or client needs to clean up its state. One of these situations is when the server is shut down. This either happens when the Stop Server button is clicked, and when the method…

Svend Hansen
- 3,277
- 3
- 31
- 50
1
vote
1 answer
Sudden app shutdown without doing any activity, throws IllegalStateException onMeasure()
My app always shutdown in random time interval (mostly from few minutes to something like 20 mins). The "App stopped working" messagebox appears. Biggest problem is, I don't do anything in app (like interacting with it), and it just random shutdown…

blackJack
- 380
- 3
- 21
1
vote
1 answer
Netty ServerSocket and Children Graceful Shutdown
I would like to close the server socket on a Netty server and then wait for all children to finish processing before executing resource cleanup.
Step 1
Wait for the Netty server socket to close on the main thread using this code where b is an…

Zixradoom
- 917
- 1
- 10
- 24
1
vote
2 answers
How to make ACTION_SHUTDOWN intent work when app is closed in android?
Android ACTION_SHUTDOWN intent not working when my app is closed. It works well when app is in foreground or background. How can achieve the same performance when app is closed?

Aditya Borde
- 1,227
- 2
- 12
- 31
1
vote
2 answers
IntentService onHandleIntent behaviour on device shutdown
What would be the behaviour of onHandleIntent on device shutdown?
I know on IntentService, the service keeps running as long as onHandleIntent didn't finish its job.
so coming to think about it its a general question about services behaviour on…

sharon gur
- 343
- 5
- 22
1
vote
1 answer
How to perform an action on shutdown?
Suppose I write a module handler.js as Express.js middleware:
var info = {};
infohandler.setinfo = function(i){ info[i] = Math.random(); }
infohandler.saveinfo = function(){ fs.writeFileSync("info.json", info); }
function handler(req, res, next){…

Kuan
- 11,149
- 23
- 93
- 201
1
vote
3 answers
Terminating Qt worker thread during program shutdown
I use Qt 4.8.6, MS Visual Studio 2008, Windows 7. I've created a GUI program. It contains main GUI thread and worker thread (I have not made QThread subclass, by the way), which makes synchronous calls to 3rd party DLL functions. These functions are…

ilya
- 1,103
- 14
- 36
1
vote
1 answer
How can I distinguish between UI Close and forced shutdown with Delphi
If a user tries to Close the application, I would like to display a Close Query confirmation dialog. If the system shuts down or the task or process is being ended from the Task Manager, I just want to clean up and close.
I tried this…

Kevin Davidson
- 131
- 8
1
vote
1 answer
MemoryCache avoid refreshing on shutdown
I use a System.Runtime.MemoryCache in a web services integration layer to keep some product lists which are external and slow to retrieve. However, I want to refresh those as they expire to free my callers from waiting on it. For that reason I am…

mmix
- 6,057
- 3
- 39
- 65
1
vote
1 answer
C# Console app Environment.Exit(0) not recognised as a shutdown event
I have a simple library that overrides a console's shutdown events to complete various tasks before closing itself. This works whenever a user or external program closes the console (ctrl+C, close window, etc), however, when the console app uses…

Dezzamondo
- 2,169
- 2
- 20
- 33
1
vote
3 answers
APscheduler will not stop
I have python code that I am developing for a website that, among other things, creates an excel sheet and then converts it into a json file. I need for this code to run continuously unless it is killed by the website administrator.
To this end, I…

Isa
- 149
- 6
- 15
1
vote
2 answers
Scala add shutdown hook to Scala swing
I have used shutdown hooks before in java apps however not in java swing.
I want to add a shutdown hook to scala swing app.
Scala swing has no main method so i have no idea how to implement it
I want to run a few methods just before closing so if…
user1086167
1
vote
3 answers
addshutdownHook is not invoked when sending a QUIT signal
I would like to terminate the Java application when 'kill -s 3 ' is executed. But Java dumps the thread information instead. Do I need to use different kill signal?

DaBears
- 291
- 4
- 9
1
vote
2 answers
Where to invoke ExecutorService.shutdown() in web application
I wonder what is correct place to shutdown ExecutorService in a web application?
According to docs ExecutorService should be shutdown, but what is correct place in the code to do that in a web application?
UPDATE: Sorry for unclarity. Let's…

Michael Z
- 3,883
- 10
- 43
- 57
1
vote
1 answer
Unity3D execute code before the game closes
Is it possible to run code before the Unity player is closed (by closed, we mean all ways of closing the program, either by Alt+F4, pressing the X button on the window corners, closed from within the game, etc.)? If yes, how?

brain56
- 2,659
- 9
- 38
- 70