summaryrefslogtreecommitdiff
path: root/ext/win32ole
diff options
context:
space:
mode:
authorsuke <suke@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-07-20 07:05:20 +0000
committersuke <suke@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-07-20 07:05:20 +0000
commit4e554319ddcf1e7026641aad4a6197afb9df03c0 (patch)
tree3d1f626d0ddbe531e2e0ead2caa5f9446304ce3f /ext/win32ole
parent8ceaf90948efa2561bfec11739c234b859a9b5a2 (diff)
* ext/win32ole/win32ole.c (EVENTSINK_Invoke): use rb_protect
instead of rb_rescue2. [ruby-dev:35595] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18135 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/win32ole')
-rw-r--r--ext/win32ole/win32ole.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/ext/win32ole/win32ole.c b/ext/win32ole/win32ole.c
index cf64666..5e8fd30 100644
--- a/ext/win32ole/win32ole.c
+++ b/ext/win32ole/win32ole.c
@@ -118,7 +118,7 @@
#define WC2VSTR(x) ole_wc2vstr((x), TRUE)
-#define WIN32OLE_VERSION "1.2.6"
+#define WIN32OLE_VERSION "1.2.7"
typedef HRESULT (STDAPICALLTYPE FNCOCREATEINSTANCEEX)
(REFCLSID, IUnknown*, DWORD, COSERVERINFO*, DWORD, MULTI_QI*);
@@ -7522,6 +7522,7 @@ STDMETHODIMP EVENTSINK_Invoke(
VALUE arg[2];
VALUE is_outarg;
BOOL is_default_handler = FALSE;
+ int state;
PIEVENTSINKOBJ pEV = (PIEVENTSINKOBJ)pEventSink;
pTypeInfo = pEV->pTypeInfo;
@@ -7571,13 +7572,14 @@ STDMETHODIMP EVENTSINK_Invoke(
*/
arg[0] = handler;
arg[1] = args;
- result = rb_rescue2(exec_callback, (VALUE)arg,
- rescue_callback, Qnil,
- rb_eException, (VALUE)0);
+ result = rb_protect(exec_callback, (VALUE)arg, &state);
+ if (state != 0) {
+ rescue_callback(Qnil);
+ }
if(TYPE(result) == T_HASH) {
hash2ptr_dispparams(result, pTypeInfo, dispid, pdispparams);
result = hash2result(result);
- }else if (is_outarg == Qtrue && outargv != Qnil) {
+ }else if (is_outarg == Qtrue && TYPE(outargv) == T_ARRAY) {
ary2ptr_dispparams(outargv, pdispparams);
}