forked from Mirrors/wine-wine
jscript: Fix create_exec_ctx implementation.
parent
8e1233ec48
commit
ea5c94f84d
|
@ -179,6 +179,8 @@ HRESULT create_exec_ctx(IDispatch *this_obj, DispatchEx *var_disp, scope_chain_t
|
|||
if(!ctx)
|
||||
return E_OUTOFMEMORY;
|
||||
|
||||
ctx->ref = 1;
|
||||
|
||||
IDispatch_AddRef(this_obj);
|
||||
ctx->this_obj = this_obj;
|
||||
|
||||
|
|
|
@ -197,9 +197,10 @@ static HRESULT invoke_constructor(FunctionInstance *function, LCID lcid, DISPPAR
|
|||
return hres;
|
||||
|
||||
hres = invoke_source(function, (IDispatch*)_IDispatchEx_(this_obj), lcid, dp, retv, ei, caller);
|
||||
jsdisp_release(this_obj);
|
||||
if(FAILED(hres))
|
||||
if(FAILED(hres)) {
|
||||
jsdisp_release(this_obj);
|
||||
return hres;
|
||||
}
|
||||
|
||||
V_VT(retv) = VT_DISPATCH;
|
||||
V_DISPATCH(retv) = (IDispatch*)_IDispatchEx_(this_obj);
|
||||
|
|
Loading…
Reference in New Issue