mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-22 10:00:33 +00:00
Don't rely on the signal delivered by raise(), as this may cause a bogus
assertion when Qt is compiled in debug mode, and simply directly perform an emergency cleanup when a shutdown event occurs on Windows. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@31029 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
33eec90086
commit
0695afbc55
@ -65,6 +65,10 @@ using ::boost::scoped_ptr;
|
||||
|
||||
namespace lyx {
|
||||
|
||||
// Keep the linker happy on Windows
|
||||
void emergencyCleanup()
|
||||
{}
|
||||
|
||||
namespace support {
|
||||
|
||||
string itoa(unsigned int i)
|
||||
|
@ -34,6 +34,9 @@
|
||||
using namespace std;
|
||||
|
||||
namespace lyx {
|
||||
|
||||
void emergencyCleanup();
|
||||
|
||||
namespace support {
|
||||
namespace os {
|
||||
|
||||
@ -129,9 +132,7 @@ BOOL terminate_handler(DWORD event)
|
||||
if (event == CTRL_CLOSE_EVENT
|
||||
|| event == CTRL_LOGOFF_EVENT
|
||||
|| event == CTRL_SHUTDOWN_EVENT) {
|
||||
::raise(SIGTERM);
|
||||
// Relinquish our time slice.
|
||||
sleep(0);
|
||||
lyx::emergencyCleanup();
|
||||
return TRUE;
|
||||
}
|
||||
return FALSE;
|
||||
|
@ -26,7 +26,6 @@
|
||||
|
||||
#include "support/lassert.h"
|
||||
|
||||
#include <csignal>
|
||||
#include <cstdlib>
|
||||
#include <vector>
|
||||
|
||||
@ -72,6 +71,9 @@
|
||||
using namespace std;
|
||||
|
||||
namespace lyx {
|
||||
|
||||
void emergencyCleanup();
|
||||
|
||||
namespace support {
|
||||
namespace os {
|
||||
|
||||
@ -86,9 +88,7 @@ BOOL terminate_handler(DWORD event)
|
||||
if (event == CTRL_CLOSE_EVENT
|
||||
|| event == CTRL_LOGOFF_EVENT
|
||||
|| event == CTRL_SHUTDOWN_EVENT) {
|
||||
::raise(SIGTERM);
|
||||
// Relinquish our time slice.
|
||||
Sleep(0);
|
||||
lyx::emergencyCleanup();
|
||||
return TRUE;
|
||||
}
|
||||
return FALSE;
|
||||
|
@ -56,6 +56,11 @@ Messages & getGuiMessages()
|
||||
}
|
||||
|
||||
|
||||
// Keep the linker happy on Windows
|
||||
void emergencyCleanup()
|
||||
{}
|
||||
|
||||
|
||||
string const trim(string const & a, char const * p)
|
||||
{
|
||||
// LASSERT(p, /**/);
|
||||
|
Loading…
Reference in New Issue
Block a user