diff --git a/PowerEditor/src/Parameters.cpp b/PowerEditor/src/Parameters.cpp index 629e14e1..df4c43e1 100644 --- a/PowerEditor/src/Parameters.cpp +++ b/PowerEditor/src/Parameters.cpp @@ -1439,6 +1439,7 @@ void NppParameters::destroyInstance() delete _pXmlContextMenuDocA; delete _pXmlSessionDoc; delete _pXmlBlacklistDoc; + delete getInstancePointer(); } diff --git a/PowerEditor/src/Parameters.h b/PowerEditor/src/Parameters.h index 0325553f..7f658605 100644 --- a/PowerEditor/src/Parameters.h +++ b/PowerEditor/src/Parameters.h @@ -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);