diff options
Diffstat (limited to 'src/activeqt/container/qaxscript.cpp')
-rw-r--r-- | src/activeqt/container/qaxscript.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/activeqt/container/qaxscript.cpp b/src/activeqt/container/qaxscript.cpp index c5504ce..7166998 100644 --- a/src/activeqt/container/qaxscript.cpp +++ b/src/activeqt/container/qaxscript.cpp @@ -113,7 +113,7 @@ protected: private: QAxScript *script; - unsigned long ref; + LONG ref; }; /* @@ -129,7 +129,7 @@ QAxScriptSite::QAxScriptSite(QAxScript *s) */ ULONG WINAPI QAxScriptSite::AddRef() { - return ++ref; + return InterlockedIncrement(&ref); } /* @@ -137,11 +137,11 @@ ULONG WINAPI QAxScriptSite::AddRef() */ ULONG WINAPI QAxScriptSite::Release() { - if (!--ref) { + LONG refCount = InterlockedDecrement(&ref); + if (!refCount) delete this; - return 0; - } - return ref; + + return refCount; } /* |