Commit ea5c94f8 authored by Piotr Caban's avatar Piotr Caban Committed by Alexandre Julliard

jscript: Fix create_exec_ctx implementation.

parent 8e1233ec
...@@ -179,6 +179,8 @@ HRESULT create_exec_ctx(IDispatch *this_obj, DispatchEx *var_disp, scope_chain_t ...@@ -179,6 +179,8 @@ HRESULT create_exec_ctx(IDispatch *this_obj, DispatchEx *var_disp, scope_chain_t
if(!ctx) if(!ctx)
return E_OUTOFMEMORY; return E_OUTOFMEMORY;
ctx->ref = 1;
IDispatch_AddRef(this_obj); IDispatch_AddRef(this_obj);
ctx->this_obj = this_obj; ctx->this_obj = this_obj;
......
...@@ -197,9 +197,10 @@ static HRESULT invoke_constructor(FunctionInstance *function, LCID lcid, DISPPAR ...@@ -197,9 +197,10 @@ static HRESULT invoke_constructor(FunctionInstance *function, LCID lcid, DISPPAR
return hres; return hres;
hres = invoke_source(function, (IDispatch*)_IDispatchEx_(this_obj), lcid, dp, retv, ei, caller); 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; return hres;
}
V_VT(retv) = VT_DISPATCH; V_VT(retv) = VT_DISPATCH;
V_DISPATCH(retv) = (IDispatch*)_IDispatchEx_(this_obj); V_DISPATCH(retv) = (IDispatch*)_IDispatchEx_(this_obj);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment