exit more abruptly to avoid mysterious core dump on quitting program
This commit is contained in:
parent
7c00fcc50b
commit
1d4a75ccca
@ -75,6 +75,11 @@ void forgetTempFile(string &fn)
|
|||||||
fn.erase();
|
fn.erase();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void deleteAllTempFiles()
|
||||||
|
{
|
||||||
|
PTMutexLocker locker(thetempfileslock);
|
||||||
|
o_tempfiles.clear();
|
||||||
|
}
|
||||||
|
|
||||||
Rcl::Db *rcldb;
|
Rcl::Db *rcldb;
|
||||||
|
|
||||||
@ -152,9 +157,8 @@ static void recollCleanup()
|
|||||||
deleteZ(rcldb);
|
deleteZ(rcldb);
|
||||||
deleteZ(theconfig);
|
deleteZ(theconfig);
|
||||||
|
|
||||||
PTMutexLocker locker(thetempfileslock);
|
deleteAllTempFiles();
|
||||||
o_tempfiles.clear();
|
|
||||||
|
|
||||||
#ifdef RCL_USE_ASPELL
|
#ifdef RCL_USE_ASPELL
|
||||||
deleteZ(aspell);
|
deleteZ(aspell);
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@ -18,6 +18,7 @@
|
|||||||
|
|
||||||
#include <utility>
|
#include <utility>
|
||||||
#include MEMORY_INCLUDE
|
#include MEMORY_INCLUDE
|
||||||
|
#include <stdlib.h>
|
||||||
|
|
||||||
#include <qapplication.h>
|
#include <qapplication.h>
|
||||||
#include <qmessagebox.h>
|
#include <qmessagebox.h>
|
||||||
@ -687,8 +688,13 @@ void RclMain::fileExit()
|
|||||||
|
|
||||||
rwSettings(true);
|
rwSettings(true);
|
||||||
|
|
||||||
// Let the exit handler clean up the rest (internal recoll stuff).
|
// We should do the right thing and let exit() call all the
|
||||||
exit(0);
|
// cleanup handlers. But we have few persistent resources and qt
|
||||||
|
// exit is a great source of crashes and pita. So do our own
|
||||||
|
// cleanup:
|
||||||
|
deleteAllTempFiles();
|
||||||
|
// and scram out
|
||||||
|
_Exit(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Start a db query and set the reslist docsource
|
// Start a db query and set the reslist docsource
|
||||||
|
|||||||
@ -39,6 +39,7 @@ extern RclConfig *theconfig;
|
|||||||
|
|
||||||
extern void rememberTempFile(TempFile);
|
extern void rememberTempFile(TempFile);
|
||||||
extern void forgetTempFile(string &fn);
|
extern void forgetTempFile(string &fn);
|
||||||
|
extern void deleteAllTempFiles();
|
||||||
|
|
||||||
extern Rcl::Db *rcldb;
|
extern Rcl::Db *rcldb;
|
||||||
extern int recollNeedsExit;
|
extern int recollNeedsExit;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user