diff --git a/goldlib/gall/gespell.cpp b/goldlib/gall/gespell.cpp index 7902b6c..0db3be4 100644 --- a/goldlib/gall/gespell.cpp +++ b/goldlib/gall/gespell.cpp @@ -231,6 +231,7 @@ bool CMSSpellLang::Load(const char *codeset, const char *userdic) { bool result = false; + if( mLibrary != NULL ) return true; // Already loaded mLibrary = LoadLibrary(mEngine); CHECK_NULL(mLibrary, cleanup0); @@ -474,6 +475,8 @@ bool CMYSpellLang::Init(const gdirentry *entry) bool CMYSpellLang::Load(const char *codeset, const char *) { + + if (mMSpell) return mIsMdrLoaded; mMSpell = new Hunspell(mEngine, mDictionary); if (mMSpell) @@ -493,6 +496,7 @@ void CMYSpellLang::UnLoad() if (!mMSpell) return; delete mMSpell; mMSpell = NULL; + mIsMdrLoaded = false; if (mToDicTable) delete mToDicTable; if (mToLocTable) delete mToLocTable; mToDicTable = mToLocTable = NULL; diff --git a/goldlib/gall/gespell.h b/goldlib/gall/gespell.h index c301d37..28fac2f 100644 --- a/goldlib/gall/gespell.h +++ b/goldlib/gall/gespell.h @@ -74,6 +74,7 @@ public: mIsMdrLoaded = mIsUdrLoaded = false; mToDicTable = mToLocTable = NULL; } + virtual ~CSpellLang() = 0; virtual bool Load(const char *codeset, const char *userdic) = 0; virtual void UnLoad() = 0; @@ -217,6 +218,7 @@ public: mLibrary = NULL; mSpellType = SCHECKET_TYPE_MSSPELL; } + virtual ~CMSSpellLang(){ UnLoad(); } bool Init(HKEY hKey, const char *name); @@ -252,6 +254,7 @@ public: mMSpell = NULL; mSpellType = SCHECKET_TYPE_MYSPELL; } + virtual ~CMYSpellLang(){ UnLoad(); } bool Init(const gdirentry *entry);