Skip to content
This repository was archived by the owner on Dec 15, 2022. It is now read-only.

Commit 18f413f

Browse files
committed
:: paranoia intensifies ::
1 parent adbd760 commit 18f413f

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/spellchecker_win.cc

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ std::wstring ToWString(const std::string& string) {
5555
}
5656

5757
WindowsSpellchecker::WindowsSpellchecker() {
58+
this->spellcheckerFactory = NULL;
5859
this->currentSpellchecker = NULL;
5960

6061
if (InterlockedIncrement(&g_COMRefcount) == 1) {
@@ -73,8 +74,14 @@ WindowsSpellchecker::WindowsSpellchecker() {
7374
}
7475

7576
WindowsSpellchecker::~WindowsSpellchecker() {
77+
if (this->currentSpellchecker) {
78+
this->currentSpellchecker->Release();
79+
this->currentSpellchecker = NULL;
80+
}
81+
7682
if (this->spellcheckerFactory) {
7783
this->spellcheckerFactory->Release();
84+
this->spellcheckerFactory = NULL;
7885
}
7986

8087
if (InterlockedDecrement(&g_COMRefcount) == 0) {
@@ -83,7 +90,7 @@ WindowsSpellchecker::~WindowsSpellchecker() {
8390
}
8491

8592
bool WindowsSpellchecker::IsSupported() {
86-
return !(g_COMFailed || (spellcheckerFactory == NULL));
93+
return !(g_COMFailed || (this->spellcheckerFactory == NULL));
8794
}
8895

8996
bool WindowsSpellchecker::SetDictionary(const std::string& language, const std::string& path) {

0 commit comments

Comments
 (0)