mirror of
https://github.com/ruby/ruby.git
synced 2025-09-18 10:03:59 +02:00
fix memory leak of win32ole.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@11530 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
5c4ae9d745
commit
6f910a6fa1
3 changed files with 24 additions and 4 deletions
|
@ -1,3 +1,9 @@
|
|||
Sat Jan 13 23:54:48 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]
|
||||
|
||||
Fri Jan 12 11:13:55 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||
|
||||
* ext/etc/etc.c (etc_getpwuid, etc_getgrgid): fix to correctly
|
||||
|
|
|
@ -30,6 +30,9 @@
|
|||
#define va_init_list(a,b) va_start(a)
|
||||
#endif
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <crtdbg.h>
|
||||
|
||||
#define DOUT fprintf(stderr,"[%d]\n",__LINE__)
|
||||
#define DOUTS(x) fprintf(stderr,"[%d]:" #x "=%s\n",__LINE__,x)
|
||||
#define DOUTMSG(x) fprintf(stderr, "[%d]:" #x "\n",__LINE__)
|
||||
|
@ -78,7 +81,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 +636,7 @@ ole_free(pole)
|
|||
struct oledata *pole;
|
||||
{
|
||||
OLE_FREE(pole->pDispatch);
|
||||
free(pole);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -640,6 +644,7 @@ oletype_free(poletype)
|
|||
struct oletypedata *poletype;
|
||||
{
|
||||
OLE_FREE(poletype->pTypeInfo);
|
||||
free(poletype);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -648,6 +653,7 @@ olemethod_free(polemethod)
|
|||
{
|
||||
OLE_FREE(polemethod->pTypeInfo);
|
||||
OLE_FREE(polemethod->pOwnerTypeInfo);
|
||||
free(polemethod);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -655,6 +661,7 @@ olevariable_free(polevar)
|
|||
struct olevariabledata *polevar;
|
||||
{
|
||||
OLE_FREE(polevar->pTypeInfo);
|
||||
free(polevar);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -662,6 +669,7 @@ oleparam_free(pole)
|
|||
struct oleparamdata *pole;
|
||||
{
|
||||
OLE_FREE(pole->pTypeInfo);
|
||||
free(pole);
|
||||
}
|
||||
|
||||
static LPWSTR
|
||||
|
@ -5871,6 +5879,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 +5894,7 @@ ole_event_free(poleev)
|
|||
pcp->lpVtbl->Unadvise(pcp, poleev->pEvent->m_dwCookie);
|
||||
OLE_RELEASE(pcp);
|
||||
}
|
||||
free(poleev);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
#define RUBY_VERSION "1.8.5"
|
||||
#define RUBY_RELEASE_DATE "2007-01-12"
|
||||
#define RUBY_RELEASE_DATE "2007-01-13"
|
||||
#define RUBY_VERSION_CODE 185
|
||||
#define RUBY_RELEASE_CODE 20070112
|
||||
#define RUBY_RELEASE_CODE 20070113
|
||||
#define RUBY_PATCHLEVEL 5000
|
||||
|
||||
#define RUBY_VERSION_MAJOR 1
|
||||
|
@ -9,7 +9,7 @@
|
|||
#define RUBY_VERSION_TEENY 5
|
||||
#define RUBY_RELEASE_YEAR 2007
|
||||
#define RUBY_RELEASE_MONTH 1
|
||||
#define RUBY_RELEASE_DAY 12
|
||||
#define RUBY_RELEASE_DAY 13
|
||||
|
||||
RUBY_EXTERN const char ruby_version[];
|
||||
RUBY_EXTERN const char ruby_release_date[];
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue