Signed-off-by: Gabriel Ivăncescu gabrielopcode@gmail.com --- dlls/jscript/jscript.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/dlls/jscript/jscript.c b/dlls/jscript/jscript.c index 5e9b153..8311eef 100644 --- a/dlls/jscript/jscript.c +++ b/dlls/jscript/jscript.c @@ -827,10 +827,10 @@ static HRESULT WINAPI JScript_AddNamedItem(IActiveScript *iface, return hres; }
- if(This->ctx->host_global) - IDispatch_Release(This->ctx->host_global); - IDispatch_AddRef(disp); - This->ctx->host_global = disp; + if(!This->ctx->host_global) { + IDispatch_AddRef(disp); + This->ctx->host_global = disp; + } }
item = heap_alloc(sizeof(*item));