Signed-off-by: Gabriel Ivăncescu gabrielopcode@gmail.com --- dlls/vbscript/compile.c | 5 ----- dlls/vbscript/interp.c | 6 +++--- dlls/vbscript/vbscript.h | 1 - 3 files changed, 3 insertions(+), 9 deletions(-)
diff --git a/dlls/vbscript/compile.c b/dlls/vbscript/compile.c index cc78daa..164c2d1 100644 --- a/dlls/vbscript/compile.c +++ b/dlls/vbscript/compile.c @@ -1867,8 +1867,6 @@ void release_vbscode(vbscode_t *code) for(i=0; i < code->bstr_cnt; i++) SysFreeString(code->bstr_pool[i]);
- if(code->context) - IDispatch_Release(code->context); if(code->named_item) release_named_item(code->named_item); heap_pool_free(&code->heap); @@ -2016,9 +2014,6 @@ HRESULT compile_script(script_ctx_t *script, const WCHAR *src, const WCHAR *item ctx.code = NULL; release_compiler(&ctx);
- if(item && item->disp) - IDispatch_AddRef(code->context = item->disp); - list_add_tail(&script->code_list, &code->entry); *ret = code; return S_OK; diff --git a/dlls/vbscript/interp.c b/dlls/vbscript/interp.c index d2e1d2a..95614b1 100644 --- a/dlls/vbscript/interp.c +++ b/dlls/vbscript/interp.c @@ -181,11 +181,11 @@ static HRESULT lookup_identifier(exec_ctx_t *ctx, BSTR name, vbdisp_invoke_type_ } }
- if(ctx->func->code_ctx->context) { - hres = disp_get_id(ctx->func->code_ctx->context, name, invoke_type, TRUE, &id); + if(ctx->func->code_ctx->named_item && ctx->func->code_ctx->named_item->disp) { + hres = disp_get_id(ctx->func->code_ctx->named_item->disp, name, invoke_type, TRUE, &id); if(SUCCEEDED(hres)) { ref->type = REF_DISP; - ref->u.d.disp = ctx->func->code_ctx->context; + ref->u.d.disp = ctx->func->code_ctx->named_item->disp; ref->u.d.id = id; return S_OK; } diff --git a/dlls/vbscript/vbscript.h b/dlls/vbscript/vbscript.h index 27ddae3..aa75b1c 100644 --- a/dlls/vbscript/vbscript.h +++ b/dlls/vbscript/vbscript.h @@ -348,7 +348,6 @@ struct _vbscode_t { BOOL pending_exec; BOOL is_persistent; function_t main_code; - IDispatch *context; named_item_t *named_item;
BSTR *bstr_pool;