mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-22 01:59:02 +00:00
Clean up word lists on exit. Not really a concrete issue, but just
get less "noise" when debugging for memory leaks. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@39865 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
f4400845af
commit
79716cbcd0
@ -44,6 +44,7 @@
|
||||
#include "Server.h"
|
||||
#include "ServerSocket.h"
|
||||
#include "Session.h"
|
||||
#include "WordList.h"
|
||||
|
||||
#include "frontends/alert.h"
|
||||
#include "frontends/Application.h"
|
||||
@ -217,6 +218,7 @@ LyX::~LyX()
|
||||
{
|
||||
delete pimpl_;
|
||||
singleton_ = 0;
|
||||
WordList::cleanupWordLists();
|
||||
}
|
||||
|
||||
|
||||
@ -446,8 +448,7 @@ void LyX::prepareExit()
|
||||
|
||||
// Kill the application object before exiting. This avoids crashes
|
||||
// when exiting on Linux.
|
||||
if (pimpl_->application_)
|
||||
pimpl_->application_.reset();
|
||||
pimpl_->application_.reset();
|
||||
}
|
||||
|
||||
|
||||
|
@ -30,6 +30,7 @@ namespace lyx {
|
||||
///
|
||||
map<Language, WordList *> theGlobalWordList;
|
||||
|
||||
|
||||
WordList * theWordList(Language const & lang)
|
||||
{
|
||||
map<Language, WordList *>::iterator it = theGlobalWordList.find(lang);
|
||||
@ -40,6 +41,15 @@ WordList * theWordList(Language const & lang)
|
||||
return theGlobalWordList[lang];
|
||||
}
|
||||
|
||||
|
||||
void WordList::cleanupWordLists() {
|
||||
map<Language, WordList *>::const_iterator it = theGlobalWordList.begin();
|
||||
for (; it != theGlobalWordList.end(); ++it)
|
||||
delete it->second;
|
||||
theGlobalWordList.clear();
|
||||
}
|
||||
|
||||
|
||||
///
|
||||
struct WordList::Impl {
|
||||
///
|
||||
|
@ -33,7 +33,9 @@ public:
|
||||
void insert(docstring const & w);
|
||||
///
|
||||
void remove(docstring const & w);
|
||||
|
||||
///
|
||||
static void cleanupWordLists();
|
||||
|
||||
private:
|
||||
struct Impl;
|
||||
Impl * d;
|
||||
|
Loading…
Reference in New Issue
Block a user