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();
|
||||
}
|
||||
|
||||
void deleteAllTempFiles()
|
||||
{
|
||||
PTMutexLocker locker(thetempfileslock);
|
||||
o_tempfiles.clear();
|
||||
}
|
||||
|
||||
Rcl::Db *rcldb;
|
||||
|
||||
@ -152,9 +157,8 @@ static void recollCleanup()
|
||||
deleteZ(rcldb);
|
||||
deleteZ(theconfig);
|
||||
|
||||
PTMutexLocker locker(thetempfileslock);
|
||||
o_tempfiles.clear();
|
||||
|
||||
deleteAllTempFiles();
|
||||
|
||||
#ifdef RCL_USE_ASPELL
|
||||
deleteZ(aspell);
|
||||
#endif
|
||||
|
||||
@ -18,6 +18,7 @@
|
||||
|
||||
#include <utility>
|
||||
#include MEMORY_INCLUDE
|
||||
#include <stdlib.h>
|
||||
|
||||
#include <qapplication.h>
|
||||
#include <qmessagebox.h>
|
||||
@ -687,8 +688,13 @@ void RclMain::fileExit()
|
||||
|
||||
rwSettings(true);
|
||||
|
||||
// Let the exit handler clean up the rest (internal recoll stuff).
|
||||
exit(0);
|
||||
// We should do the right thing and let exit() call all the
|
||||
// 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
|
||||
|
||||
@ -39,6 +39,7 @@ extern RclConfig *theconfig;
|
||||
|
||||
extern void rememberTempFile(TempFile);
|
||||
extern void forgetTempFile(string &fn);
|
||||
extern void deleteAllTempFiles();
|
||||
|
||||
extern Rcl::Db *rcldb;
|
||||
extern int recollNeedsExit;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user