summaryrefslogtreecommitdiff
path: root/plugins/Scriver/src
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2015-04-10 14:25:42 +0000
committerGeorge Hazan <george.hazan@gmail.com>2015-04-10 14:25:42 +0000
commit77a9ce1c7510cdf66bf038300ce57952748a3e05 (patch)
treeee1689e603b83f7f359c6098be2881e0c5b707c0 /plugins/Scriver/src
parent11c3c76e22bb5778da1f14041fd6bac50d2cc747 (diff)
- fix for CREOleCallback constructor;
- unsafe strlen call removed; - fix for static buffer lengths git-svn-id: http://svn.miranda-ng.org/main/trunk@12736 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/Scriver/src')
-rw-r--r--plugins/Scriver/src/msgs.cpp12
-rw-r--r--plugins/Scriver/src/msgs.h2
2 files changed, 7 insertions, 7 deletions
diff --git a/plugins/Scriver/src/msgs.cpp b/plugins/Scriver/src/msgs.cpp
index 910a7ee1dd..9d6724ed1e 100644
--- a/plugins/Scriver/src/msgs.cpp
+++ b/plugins/Scriver/src/msgs.cpp
@@ -599,19 +599,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/Scriver/src/msgs.h b/plugins/Scriver/src/msgs.h
index cc991e6c87..cbd32beb0b 100644
--- a/plugins/Scriver/src/msgs.h
+++ b/plugins/Scriver/src/msgs.h
@@ -193,7 +193,7 @@ struct SrmmWindowData : public CommonWindowData
struct CREOleCallback : public IRichEditOleCallback
{
- CREOleCallback() : refCount(0) {}
+ CREOleCallback() : refCount(0), nextStgId(0), pictStg(NULL) {}
unsigned refCount;
IStorage *pictStg;
int nextStgId;