fix memory leak of win32ole.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@11529 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
suke 2007-01-13 14:40:54 +00:00
parent 77619b3a56
commit d2907d42be
3 changed files with 22 additions and 5 deletions

View File

@ -1,3 +1,9 @@
Sat Jan 13 23:24:59 2007 Masaki Suketa <masaki.suketa@nifty.ne.jp>
* ext/win32ole/win32ole.c (ole_free, ole_type_free,
olemethod_free, olevariable_free, oleparam_free,
ole_event_free): fix memory leak. [ruby-core:09846]
Wed Jan 10 00:10:23 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
* array.c (rb_ary_replace): use ptr and len of orig instead of

View File

@ -79,7 +79,7 @@
#define WC2VSTR(x) ole_wc2vstr((x), TRUE)
#define WIN32OLE_VERSION "0.8.2"
#define WIN32OLE_VERSION "0.8.3"
typedef HRESULT (STDAPICALLTYPE FNCOCREATEINSTANCEEX)
(REFCLSID, IUnknown*, DWORD, COSERVERINFO*, DWORD, MULTI_QI*);
@ -619,12 +619,14 @@ static void
ole_free(struct oledata *pole)
{
OLE_FREE(pole->pDispatch);
free(pole);
}
static void
oletype_free(struct oletypedata *poletype)
{
OLE_FREE(poletype->pTypeInfo);
free(poletype);
}
static void
@ -632,18 +634,21 @@ olemethod_free(struct olemethoddata *polemethod)
{
OLE_FREE(polemethod->pTypeInfo);
OLE_FREE(polemethod->pOwnerTypeInfo);
free(polemethod);
}
static void
olevariable_free(struct olevariabledata *polevar)
{
OLE_FREE(polevar->pTypeInfo);
free(polevar);
}
static void
oleparam_free(struct oleparamdata *pole)
{
OLE_FREE(pole->pTypeInfo);
free(pole);
}
static LPWSTR
@ -6604,7 +6609,12 @@ ole_event_free(struct oleeventdata *poleev)
IConnectionPoint *pcp = NULL;
if (poleev->freed == 1) {
return;
/*
* this return create memory leak.
* but poleev->pEvent->pConnectionPoint shoul'd not be freed
* until poleev-> freed == 0.
*/
return;
}
if(poleev->pEvent) {
pti = poleev->pEvent->pTypeInfo;
@ -6614,6 +6624,7 @@ ole_event_free(struct oleeventdata *poleev)
pcp->lpVtbl->Unadvise(pcp, poleev->pEvent->m_dwCookie);
OLE_RELEASE(pcp);
}
free(poleev);
}
}

View File

@ -1,7 +1,7 @@
#define RUBY_VERSION "1.9.0"
#define RUBY_RELEASE_DATE "2007-01-10"
#define RUBY_RELEASE_DATE "2007-01-13"
#define RUBY_VERSION_CODE 190
#define RUBY_RELEASE_CODE 20070110
#define RUBY_RELEASE_CODE 20070113
#define RUBY_PATCHLEVEL 0
#define RUBY_VERSION_MAJOR 1
@ -9,7 +9,7 @@
#define RUBY_VERSION_TEENY 0
#define RUBY_RELEASE_YEAR 2007
#define RUBY_RELEASE_MONTH 1
#define RUBY_RELEASE_DAY 10
#define RUBY_RELEASE_DAY 13
RUBY_EXTERN const char ruby_version[];
RUBY_EXTERN const char ruby_release_date[];