2022-03-13 05:10:01 +00:00
|
|
|
|
2012-02-20 21:47:14 +00:00
|
|
|
/* This file is (c) 2008-2012 Konstantin Isakov <ikm@goldendict.org>
|
2010-01-17 13:04:55 +00:00
|
|
|
* Part of GoldenDict. Licensed under GPLv3 or later, see the LICENSE file */
|
|
|
|
|
|
|
|
#include "logfileptr.hh"
|
|
|
|
#include "termination.hh"
|
|
|
|
#include <QDebug>
|
|
|
|
#include <exception>
|
|
|
|
|
|
|
|
static void termHandler()
|
|
|
|
{
|
2023-07-08 13:57:21 +00:00
|
|
|
qDebug() << "GoldenDict has crashed unexpectedly.\n\n";
|
2022-03-13 05:10:01 +00:00
|
|
|
|
2018-05-22 14:37:21 +00:00
|
|
|
if ( logFilePtr && logFilePtr->isOpen() ) {
|
|
|
|
logFilePtr->close();
|
2024-10-10 07:13:23 +00:00
|
|
|
}
|
2013-09-20 14:25:44 +00:00
|
|
|
|
2022-03-13 05:10:01 +00:00
|
|
|
abort();
|
2010-01-17 13:04:55 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void installTerminationHandler()
|
|
|
|
{
|
|
|
|
std::set_terminate( termHandler );
|
|
|
|
}
|