From 1f001a65e27489f296c9b349966c171157ca17b8 Mon Sep 17 00:00:00 2001 From: lordmulder Date: Thu, 29 Dec 2011 14:42:20 +0100 Subject: [PATCH] Better handling of system shutdown. Now using the Qt event system to broadcast a special event when the system is going to shutdown (i.e. WM_QUERYENDSESSION or WM_ENDSESSION). This gives each top-level widget the chance to react to the system shutdown *before* we return from the message handler. Doing any clean-up after returning from the message handler is impossible, because Windows will kill the process immediately after WM_ENDSESSION has been processed. Note that Windows XP (and earlier) will NOT send WM_QUERYENDSESSION or WM_ENDSESSION to processes that have a console attached! Therefore, if we have a debug console attached, we cannot do anything on these systems. Our process will be killed without any notification... Also improved LameXP's IPC mechanism: There now are several slots for IPC-commands in the shared memory area ("queue support"). This way, the sender can post several commands in sequence without getting blocked. The receiver can process those at a later time. --- doc/Changelog.html | 2 + etc/Translation/Blank.ts | 388 +++++++++++++++++----------------- etc/Translation/LameXP_PL.ts | 388 +++++++++++++++++----------------- src/Config.h | 4 +- src/Dialog_MainWindow.cpp | 29 ++- src/Dialog_MainWindow.h | 17 +- src/Dialog_Processing.cpp | 51 +++-- src/Dialog_Processing.h | 6 +- src/Dialog_SplashScreen.cpp | 2 +- src/Dialog_Update.cpp | 2 +- src/Dialog_WorkingBanner.cpp | 7 +- src/Dialog_WorkingBanner.h | 2 +- src/Global.cpp | 200 ++++++++++++------ src/Global.h | 10 +- src/Main.cpp | 4 +- src/Thread_MessageHandler.cpp | 2 +- src/Thread_MessageHandler.h | 2 +- 17 files changed, 623 insertions(+), 493 deletions(-) diff --git a/doc/Changelog.html b/doc/Changelog.html index 66cb1bc0..99c10062 100644 --- a/doc/Changelog.html +++ b/doc/Changelog.html @@ -26,7 +26,9 @@ a:visited { color: #0000EE; }
  • Implemented coalescing of update signals to reduce the CPU usage of the LameXP process (details)
  • Run more than four instances in parallel on systems with more than four CPU cores (details)
  • Improved handling of different character encodings for Playlist and Cue Sheet import +
  • Improved LameXP inter-process communication by adding queue support
  • Workaround for a bug that causes MediaInfo to not detect the duration of Wave files (64-Bit only) +
  • Prevent LameXP from blocking a system shutdown (encoding process is aborted, if necessary)
    Changes between v4.02 and v4.03: