application-shutdown

Preventing WinForm application shutdown not working

笑着哭i 提交于 2020-02-23 06:51:32
问题 I'm using the following c # code to temporarily block the shutdown of a WinForm application without success, what I observe is that the System doesn't shutdown at all, probably because the work I have to do when receiving the shutdown notification is being made on the UI thread. Windows does not terminate the application if the application is unresponsive after 30 secs as documented. See the attached image.enter image description here public Form1() { InitializeComponent(); // Define the

How to log within shutdown hooks with Log4j2?

倾然丶 夕夏残阳落幕 提交于 2020-01-19 01:15:30
问题 Log4j2 also uses shutdown hooks to end it's services. But of course I want to log throughout the whole lifecycle of my application - shutdown included. With Log4j this was no problem. Now it seems to be impossible. Logging shuts down, while my application is still working on it. Has anyone some hope for me? Best regards Martin 回答1: As of 2.0-beta9 this is now configurable in xml <configuration ... shutdownHook="disable"> Considering its now disabled, I guess I need to manually shutdown the

How to log within shutdown hooks with Log4j2?

ぐ巨炮叔叔 提交于 2020-01-19 01:13:26
问题 Log4j2 also uses shutdown hooks to end it's services. But of course I want to log throughout the whole lifecycle of my application - shutdown included. With Log4j this was no problem. Now it seems to be impossible. Logging shuts down, while my application is still working on it. Has anyone some hope for me? Best regards Martin 回答1: As of 2.0-beta9 this is now configurable in xml <configuration ... shutdownHook="disable"> Considering its now disabled, I guess I need to manually shutdown the

How to log within shutdown hooks with Log4j2?

a 夏天 提交于 2020-01-19 01:12:34
问题 Log4j2 also uses shutdown hooks to end it's services. But of course I want to log throughout the whole lifecycle of my application - shutdown included. With Log4j this was no problem. Now it seems to be impossible. Logging shuts down, while my application is still working on it. Has anyone some hope for me? Best regards Martin 回答1: As of 2.0-beta9 this is now configurable in xml <configuration ... shutdownHook="disable"> Considering its now disabled, I guess I need to manually shutdown the

How to log within shutdown hooks with Log4j2?

痴心易碎 提交于 2020-01-19 01:11:40
问题 Log4j2 also uses shutdown hooks to end it's services. But of course I want to log throughout the whole lifecycle of my application - shutdown included. With Log4j this was no problem. Now it seems to be impossible. Logging shuts down, while my application is still working on it. Has anyone some hope for me? Best regards Martin 回答1: As of 2.0-beta9 this is now configurable in xml <configuration ... shutdownHook="disable"> Considering its now disabled, I guess I need to manually shutdown the

Shutdown exception handling for Win32/C++

时光毁灭记忆、已成空白 提交于 2019-12-31 04:36:09
问题 I have a process that handles exceptions great. It calls: _set_se_translator(exception_trans_func); SetUnhandledExceptionFilter(UnhandledExceptionFilterHandler); _set_purecall_handler(purecallHandler); set_terminate(terminateHandler); set_unexpected(unexpectedHandler); _set_invalid_parameter_handler(InvalidParameterHandler); atexit(exitHandler); //ignored during an expected exit _onexit(onexitHandler); //ignored during an expected exit Anytime an exception happens, one of the handlers is

How to make ACTION_SHUTDOWN intent work when app is closed in android?

…衆ロ難τιáo~ 提交于 2019-12-25 07:39:31
问题 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? 回答1: Check the following in your manifest file <uses-permission android:name="android.permission.DEVICE_POWER" /> ..... <receiver android:name=".ShutdownReceiver"> <intent-filter> <action android:name="android.intent.action.ACTION_SHUTDOWN" /> </intent-filter> </receiver> check here: Android ACTION_SHUTDOWN Broadcast

Workaround for non-compliant JVM not sending WindowClosing events

拥有回忆 提交于 2019-12-25 03:08:54
问题 Apple JVM on various OS X version have apparently been broken in that they do not generate the WindowClosing event when they should (for example if you close an app's main JFrame using by clicking on the close button). (in the most recent Apple Java updates you can set a property forcing the event to be generated but this is not what I'm looking for) My problem is simple: I'd like to display a "tip" when the user closes the app. However I cannot (due to the fact that no event is generated)

How to implement thread pool that will automatically shutdown at end of execution?

*爱你&永不变心* 提交于 2019-12-22 13:01:02
问题 I'm writing a Java client which could theoretically be used in a different environment: Java main(), in a servlet container, or via dependency injection. The client implements internal connection thread pooling. The problem with this approach is that users of the client that are unaware of the fact that an internal thread pool is implemented will see his or her application "hang" on shutdown. My users need to know to send a shutdown() message to the library. I'm wondering if any other

How to debug a crash that only occurs on application shutdown? (Delphi)

我只是一个虾纸丫 提交于 2019-12-21 03:53:47
问题 So, after some recent changes we discovered that one of our oldest applications is sometimes crashing on shutdown. This manifests itself either in the form of "Runtime error 216" messages or in a message from Windows Error Reporting that the application has stopped working. The application is already emitting OutputDebugString -messages at every turn and AFAICT all of our own code gets executed correctly to completion. All destructors are called as are all finalization sections and class