diff options
author | Andy Shaw <andy.shaw@qt.io> | 2017-04-27 01:06:07 +0200 |
---|---|---|
committer | Andy Shaw <andy.shaw@qt.io> | 2017-04-27 15:04:24 +0000 |
commit | 988a5837e932f55e190d288cd395eebde28052e3 (patch) | |
tree | ab388f33e06b3f5db94c5fcf2b170a1cd27fd11b | |
parent | b0c50bc1e89085c1f8f9f311d4eaa6802a15168c (diff) | |
download | qtactiveqt-988a5837e932f55e190d288cd395eebde28052e3.tar.gz |
Fix previous optimization to prevent a crash
In 2faaec4e061c7f531624cad3cba5921ed3a51b20, optimizations were done to
fix warnings as indicated by the Clang model. However the combining of
the two ifs caused a problem as riid might still be equal to
IID_IPropertyNotifySink and be the same as ciid. Therefore the check has
to be the last one done to account for other possibilities first.
Change-Id: I6a5f38beb723407b4bea8ab58c04ebbd1b900140
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
-rw-r--r-- | src/activeqt/container/qaxbase.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/activeqt/container/qaxbase.cpp b/src/activeqt/container/qaxbase.cpp index 4c0bae7..22aec57 100644 --- a/src/activeqt/container/qaxbase.cpp +++ b/src/activeqt/container/qaxbase.cpp @@ -334,10 +334,10 @@ public: *ppvObject = 0; if (riid == IID_IUnknown) *ppvObject = static_cast<IUnknown *>(static_cast<IDispatch *>(this)); - else if (riid == IID_IDispatch || ciid == riid) - *ppvObject = static_cast<IDispatch *>(this); else if (riid == IID_IPropertyNotifySink) *ppvObject = static_cast<IPropertyNotifySink *>(this); + else if (riid == IID_IDispatch || ciid == riid) + *ppvObject = static_cast<IDispatch *>(this); else return E_NOINTERFACE; |