summaryrefslogtreecommitdiffstats
path: root/src/activeqt/container/qaxwidget.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/activeqt/container/qaxwidget.cpp')
-rw-r--r--src/activeqt/container/qaxwidget.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/activeqt/container/qaxwidget.cpp b/src/activeqt/container/qaxwidget.cpp
index 92a1e11729..a11ac7a61b 100644
--- a/src/activeqt/container/qaxwidget.cpp
+++ b/src/activeqt/container/qaxwidget.cpp
@@ -408,7 +408,7 @@ private:
CONTROLINFO control_info;
QSize sizehint;
- unsigned long ref;
+ LONG ref;
QAxWidget *widget;
QAxHostWidget *host;
#if !defined(Q_WS_WINCE)
@@ -774,16 +774,16 @@ void QAxClientSite::deactivate()
//**** IUnknown
unsigned long WINAPI QAxClientSite::AddRef()
{
- return ++ref;
+ return InterlockedIncrement(&ref);
}
unsigned long WINAPI QAxClientSite::Release()
{
- if (!--ref) {
+ LONG refCount = InterlockedDecrement(&ref);
+ if (!refCount)
delete this;
- return 0;
- }
- return ref;
+
+ return refCount;
}
HRESULT WINAPI QAxClientSite::QueryInterface(REFIID iid, void **iface)