diff options
Diffstat (limited to 'src/core/stdchat')
-rw-r--r-- | src/core/stdchat/src/chat.h | 2 | ||||
-rw-r--r-- | src/core/stdchat/src/main.cpp | 12 |
2 files changed, 7 insertions, 7 deletions
diff --git a/src/core/stdchat/src/chat.h b/src/core/stdchat/src/chat.h index 97c5496fd1..6212eb7c73 100644 --- a/src/core/stdchat/src/chat.h +++ b/src/core/stdchat/src/chat.h @@ -113,7 +113,7 @@ extern BOOL SmileyAddInstalled, PopupInstalled; struct CREOleCallback : public IRichEditOleCallback
{
- CREOleCallback() : refCount(0) {}
+ CREOleCallback() : refCount(0), nextStgId(0), pictStg(NULL) {}
unsigned refCount;
IStorage *pictStg;
int nextStgId;
diff --git a/src/core/stdchat/src/main.cpp b/src/core/stdchat/src/main.cpp index 9437b3a034..48b31036a2 100644 --- a/src/core/stdchat/src/main.cpp +++ b/src/core/stdchat/src/main.cpp @@ -420,19 +420,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;
}
|