jscript: Fix create_exec_ctx implementation.

This commit is contained in:
Piotr Caban 2009-07-16 01:17:00 +02:00 committed by Alexandre Julliard
parent 8e1233ec48
commit ea5c94f84d
2 changed files with 5 additions and 2 deletions

View File

@ -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;

View File

@ -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);