diff options
Diffstat (limited to 'plugins/TabSRMM/src')
-rw-r--r-- | plugins/TabSRMM/src/msgs.cpp | 12 | ||||
-rw-r--r-- | plugins/TabSRMM/src/msgs.h | 2 |
2 files changed, 7 insertions, 7 deletions
diff --git a/plugins/TabSRMM/src/msgs.cpp b/plugins/TabSRMM/src/msgs.cpp index 8fcf781352..4e2248f185 100644 --- a/plugins/TabSRMM/src/msgs.cpp +++ b/plugins/TabSRMM/src/msgs.cpp @@ -1004,19 +1004,19 @@ STDMETHODIMP CREOleCallback::QueryInterface(REFIID riid, LPVOID * ppvObj) STDMETHODIMP_(ULONG) CREOleCallback::AddRef()
{
- if (refCount == 0) {
- if (S_OK != StgCreateDocfile(NULL, STGM_READWRITE | STGM_SHARE_EXCLUSIVE | STGM_CREATE | STGM_DELETEONRELEASE, 0, &pictStg))
- pictStg = NULL;
- nextStgId = 0;
- }
+ if (refCount == 0)
+ StgCreateDocfile(NULL, STGM_READWRITE | STGM_SHARE_EXCLUSIVE | STGM_CREATE | STGM_DELETEONRELEASE, 0, &pictStg);
+
return ++refCount;
}
STDMETHODIMP_(ULONG) CREOleCallback::Release()
{
if (--refCount == 0) {
- if (pictStg)
+ if (pictStg) {
pictStg->Release();
+ pictStg = NULL;
+ }
}
return refCount;
}
diff --git a/plugins/TabSRMM/src/msgs.h b/plugins/TabSRMM/src/msgs.h index c5f3d52032..e1f79b8717 100644 --- a/plugins/TabSRMM/src/msgs.h +++ b/plugins/TabSRMM/src/msgs.h @@ -607,7 +607,7 @@ struct TNewWindowData struct CREOleCallback : public IRichEditOleCallback
{
- CREOleCallback() : refCount(0) {}
+ CREOleCallback() : refCount(0), nextStgId(0), pictStg(NULL) {}
unsigned refCount;
IStorage *pictStg;
int nextStgId;
|