1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* ext/win32ole/win32ole_event.c(ev_advise, ole_event_free,

fev_s_allocate, fev_unadvise): avoid segmentation fault when COM
  server freed before calling Unadvise from WIN32OLE_EVENT object.
* ext/win32ole/win32ole.c: ditto.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47570 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
suke 2014-09-13 02:28:47 +00:00
parent da7475b00d
commit 5b800bef9e
3 changed files with 14 additions and 1 deletions

View file

@ -1,3 +1,10 @@
Sat Sep 13 11:16:58 2014 Masaki Suketa <masaki.suketa@nifty.ne.jp>
* ext/win32ole/win32ole_event.c(ev_advise, ole_event_free,
fev_s_allocate, fev_unadvise): avoid segmentation fault when COM
server freed before calling Unadvise from WIN32OLE_EVENT object.
* ext/win32ole/win32ole.c: ditto.
Sat Sep 13 09:47:44 2014 Eric Wong <e@80x24.org>
* man/ruby.1: use https for *.ruby-lang.org links

View file

@ -26,7 +26,7 @@
const IID IID_IMultiLanguage2 = {0xDCCFC164, 0x2B38, 0x11d2, {0xB7, 0xEC, 0x00, 0xC0, 0x4F, 0x8F, 0x5D, 0x9A}};
#endif
#define WIN32OLE_VERSION "1.8.1"
#define WIN32OLE_VERSION "1.8.2"
typedef HRESULT (STDAPICALLTYPE FNCOCREATEINSTANCEEX)
(REFCLSID, IUnknown*, DWORD, COSERVERINFO*, DWORD, MULTI_QI*);

View file

@ -58,6 +58,7 @@ typedef struct tagIEVENTSINKOBJ {
struct oleeventdata {
DWORD dwCookie;
IConnectionPoint *pConnectionPoint;
IDispatch *pDispatch;
long event_id;
};
@ -857,6 +858,7 @@ ole_event_free(struct oleeventdata *poleev)
OLE_RELEASE(poleev->pConnectionPoint);
poleev->pConnectionPoint = NULL;
}
OLE_RELEASE(poleev->pDispatch);
free(poleev);
}
@ -869,6 +871,7 @@ fev_s_allocate(VALUE klass)
poleev->dwCookie = 0;
poleev->pConnectionPoint = NULL;
poleev->event_id = 0;
poleev->pDispatch = NULL;
return obj;
}
@ -946,6 +949,8 @@ ev_advise(int argc, VALUE *argv, VALUE self)
poleev->dwCookie = dwCookie;
poleev->pConnectionPoint = pConnectionPoint;
poleev->event_id = pIEV->m_event_id;
poleev->pDispatch = pDispatch;
OLE_ADDREF(pDispatch);
return self;
}
@ -1147,6 +1152,7 @@ fev_unadvise(VALUE self)
OLE_RELEASE(poleev->pConnectionPoint);
poleev->pConnectionPoint = NULL;
}
OLE_FREE(poleev->pDispatch);
return Qnil;
}