diff options
author | suke <suke@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2007-01-13 22:57:47 +0000 |
---|---|---|
committer | suke <suke@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2007-01-13 22:57:47 +0000 |
commit | f9c1d3425b54c2ca3f7799362cd73d7e00f1ce03 (patch) | |
tree | 395cd50659ae78e5a99cf76d9d723bdc044b69cf /ext/win32ole | |
parent | 7295523013b2352dd13411d0b59a490b026825fd (diff) |
fix memory leak of win32ole.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8_5@11532 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/win32ole')
-rw-r--r-- | ext/win32ole/win32ole.c | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/ext/win32ole/win32ole.c b/ext/win32ole/win32ole.c index 6b7d2569d3..a15794d0f2 100644 --- a/ext/win32ole/win32ole.c +++ b/ext/win32ole/win32ole.c @@ -78,7 +78,7 @@ #define WC2VSTR(x) ole_wc2vstr((x), TRUE) -#define WIN32OLE_VERSION "0.6.9" +#define WIN32OLE_VERSION "0.7.0" typedef HRESULT (STDAPICALLTYPE FNCOCREATEINSTANCEEX) (REFCLSID, IUnknown*, DWORD, COSERVERINFO*, DWORD, MULTI_QI*); @@ -633,6 +633,7 @@ ole_free(pole) struct oledata *pole; { OLE_FREE(pole->pDispatch); + free(pole); } static void @@ -640,6 +641,7 @@ oletype_free(poletype) struct oletypedata *poletype; { OLE_FREE(poletype->pTypeInfo); + free(poletype); } static void @@ -648,6 +650,7 @@ olemethod_free(polemethod) { OLE_FREE(polemethod->pTypeInfo); OLE_FREE(polemethod->pOwnerTypeInfo); + free(polemethod); } static void @@ -655,6 +658,7 @@ olevariable_free(polevar) struct olevariabledata *polevar; { OLE_FREE(polevar->pTypeInfo); + free(polevar); } static void @@ -662,6 +666,7 @@ oleparam_free(pole) struct oleparamdata *pole; { OLE_FREE(pole->pTypeInfo); + free(pole); } static LPWSTR @@ -5871,6 +5876,11 @@ ole_event_free(poleev) IConnectionPoint *pcp = NULL; if (poleev->freed == 1) { + /* + * this return create memory leak. + * but poleev->pEvent->pConnectionPoint shoul'd not be freed + * until poleev-> freed == 0. + */ return; } if(poleev->pEvent) { @@ -5881,6 +5891,7 @@ ole_event_free(poleev) pcp->lpVtbl->Unadvise(pcp, poleev->pEvent->m_dwCookie); OLE_RELEASE(pcp); } + free(poleev); } } |