Skip to content

Commit 592b8d8

Browse files
committed
Fix a regression bug caused by accidentally removed lock-protected ref-counting in Ime::Module.
1 parent 51a7ce4 commit 592b8d8

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

ImeModule.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -505,11 +505,11 @@ STDMETHODIMP_(ULONG) ImeModule::Release(void) {
505505
// The last reference is released in DllMain() when unloading.
506506
// Hence interlocked operations are enough here, I guess.
507507
assert(refCount_ > 0);
508-
const ULONG newCount = --refCount_;
509508
if(::InterlockedExchangeSubtract(&refCount_, 1) == 1) {
510509
delete this;
510+
return 0;
511511
}
512-
return newCount;
512+
return refCount_;
513513
}
514514

515515
// IClassFactory

0 commit comments

Comments
 (0)