Fix a memory leak for NppParameters

Fix a memory leak due to not releasing allocated memory for NppParameters while quitting Notepad++
pull/6202/head
Don HO 5 years ago
parent 5cf296ee10
commit 445dc5ebc1
No known key found for this signature in database
GPG Key ID: 6C429F1D8D84F46E

@ -1439,6 +1439,7 @@ void NppParameters::destroyInstance()
delete _pXmlContextMenuDocA;
delete _pXmlSessionDoc;
delete _pXmlBlacklistDoc;
delete getInstancePointer();
}

@ -1291,11 +1291,17 @@ const int RECENTFILES_SHOWONLYFILENAME = 0;
class NppParameters final
{
private:
static NppParameters* getInstancePointer() {
static NppParameters* instance = new NppParameters;
return instance;
};
public:
static NppParameters& getInstance() {
static NppParameters* instance = new NppParameters;
return *instance;
return *getInstancePointer();
};
static LangType getLangIDFromStr(const TCHAR *langName);
static generic_string getLocPathFromStr(const generic_string & localizationCode);

Loading…
Cancel
Save