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:
parent
77619b3a56
commit
d2907d42be
@ -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>
|
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
|
* array.c (rb_ary_replace): use ptr and len of orig instead of
|
||||||
|
@ -79,7 +79,7 @@
|
|||||||
|
|
||||||
#define WC2VSTR(x) ole_wc2vstr((x), TRUE)
|
#define WC2VSTR(x) ole_wc2vstr((x), TRUE)
|
||||||
|
|
||||||
#define WIN32OLE_VERSION "0.8.2"
|
#define WIN32OLE_VERSION "0.8.3"
|
||||||
|
|
||||||
typedef HRESULT (STDAPICALLTYPE FNCOCREATEINSTANCEEX)
|
typedef HRESULT (STDAPICALLTYPE FNCOCREATEINSTANCEEX)
|
||||||
(REFCLSID, IUnknown*, DWORD, COSERVERINFO*, DWORD, MULTI_QI*);
|
(REFCLSID, IUnknown*, DWORD, COSERVERINFO*, DWORD, MULTI_QI*);
|
||||||
@ -619,12 +619,14 @@ static void
|
|||||||
ole_free(struct oledata *pole)
|
ole_free(struct oledata *pole)
|
||||||
{
|
{
|
||||||
OLE_FREE(pole->pDispatch);
|
OLE_FREE(pole->pDispatch);
|
||||||
|
free(pole);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
oletype_free(struct oletypedata *poletype)
|
oletype_free(struct oletypedata *poletype)
|
||||||
{
|
{
|
||||||
OLE_FREE(poletype->pTypeInfo);
|
OLE_FREE(poletype->pTypeInfo);
|
||||||
|
free(poletype);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@ -632,18 +634,21 @@ olemethod_free(struct olemethoddata *polemethod)
|
|||||||
{
|
{
|
||||||
OLE_FREE(polemethod->pTypeInfo);
|
OLE_FREE(polemethod->pTypeInfo);
|
||||||
OLE_FREE(polemethod->pOwnerTypeInfo);
|
OLE_FREE(polemethod->pOwnerTypeInfo);
|
||||||
|
free(polemethod);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
olevariable_free(struct olevariabledata *polevar)
|
olevariable_free(struct olevariabledata *polevar)
|
||||||
{
|
{
|
||||||
OLE_FREE(polevar->pTypeInfo);
|
OLE_FREE(polevar->pTypeInfo);
|
||||||
|
free(polevar);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
oleparam_free(struct oleparamdata *pole)
|
oleparam_free(struct oleparamdata *pole)
|
||||||
{
|
{
|
||||||
OLE_FREE(pole->pTypeInfo);
|
OLE_FREE(pole->pTypeInfo);
|
||||||
|
free(pole);
|
||||||
}
|
}
|
||||||
|
|
||||||
static LPWSTR
|
static LPWSTR
|
||||||
@ -6604,6 +6609,11 @@ ole_event_free(struct oleeventdata *poleev)
|
|||||||
IConnectionPoint *pcp = NULL;
|
IConnectionPoint *pcp = NULL;
|
||||||
|
|
||||||
if (poleev->freed == 1) {
|
if (poleev->freed == 1) {
|
||||||
|
/*
|
||||||
|
* this return create memory leak.
|
||||||
|
* but poleev->pEvent->pConnectionPoint shoul'd not be freed
|
||||||
|
* until poleev-> freed == 0.
|
||||||
|
*/
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if(poleev->pEvent) {
|
if(poleev->pEvent) {
|
||||||
@ -6614,6 +6624,7 @@ ole_event_free(struct oleeventdata *poleev)
|
|||||||
pcp->lpVtbl->Unadvise(pcp, poleev->pEvent->m_dwCookie);
|
pcp->lpVtbl->Unadvise(pcp, poleev->pEvent->m_dwCookie);
|
||||||
OLE_RELEASE(pcp);
|
OLE_RELEASE(pcp);
|
||||||
}
|
}
|
||||||
|
free(poleev);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
#define RUBY_VERSION "1.9.0"
|
#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_VERSION_CODE 190
|
||||||
#define RUBY_RELEASE_CODE 20070110
|
#define RUBY_RELEASE_CODE 20070113
|
||||||
#define RUBY_PATCHLEVEL 0
|
#define RUBY_PATCHLEVEL 0
|
||||||
|
|
||||||
#define RUBY_VERSION_MAJOR 1
|
#define RUBY_VERSION_MAJOR 1
|
||||||
@ -9,7 +9,7 @@
|
|||||||
#define RUBY_VERSION_TEENY 0
|
#define RUBY_VERSION_TEENY 0
|
||||||
#define RUBY_RELEASE_YEAR 2007
|
#define RUBY_RELEASE_YEAR 2007
|
||||||
#define RUBY_RELEASE_MONTH 1
|
#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_version[];
|
||||||
RUBY_EXTERN const char ruby_release_date[];
|
RUBY_EXTERN const char ruby_release_date[];
|
||||||
|
Loading…
x
Reference in New Issue
Block a user