Commit 305234e5 authored by Sven Baars's avatar Sven Baars Committed by Alexandre Julliard

msscript.ocx/tests: Fix some memory leaks (Valgrind).

parent d73a6bae
...@@ -283,8 +283,11 @@ static HRESULT WINAPI ActiveScript_SetScriptSite(IActiveScript *iface, IActiveSc ...@@ -283,8 +283,11 @@ static HRESULT WINAPI ActiveScript_SetScriptSite(IActiveScript *iface, IActiveSc
ok(hres == S_OK, "Could not get IActiveScriptSiteWindow interface: %08x\n", hres); ok(hres == S_OK, "Could not get IActiveScriptSiteWindow interface: %08x\n", hres);
IActiveScriptSiteWindow_Release(window); IActiveScriptSiteWindow_Release(window);
if (site)
IActiveScriptSite_Release(site);
site = pass; site = pass;
IActiveScriptSite_AddRef(site); IActiveScriptSite_AddRef(site);
return S_OK; return S_OK;
} }
...@@ -430,6 +433,7 @@ static HRESULT WINAPI ClassFactory_CreateInstance(IClassFactory *iface, IUnknown ...@@ -430,6 +433,7 @@ static HRESULT WINAPI ClassFactory_CreateInstance(IClassFactory *iface, IUnknown
ok(!outer, "outer = %p\n", outer); ok(!outer, "outer = %p\n", outer);
ok(IsEqualGUID(&IID_IActiveScript, riid), "unexpected riid %s\n", wine_dbgstr_guid(riid)); ok(IsEqualGUID(&IID_IActiveScript, riid), "unexpected riid %s\n", wine_dbgstr_guid(riid));
*ppv = &ActiveScript; *ppv = &ActiveScript;
site = NULL;
return S_OK; return S_OK;
} }
...@@ -780,6 +784,8 @@ static void test_Language(void) ...@@ -780,6 +784,8 @@ static void test_Language(void)
ok(!lstrcmpW(testscriptW, str), "%s\n", wine_dbgstr_w(str)); ok(!lstrcmpW(testscriptW, str), "%s\n", wine_dbgstr_w(str));
SysFreeString(str); SysFreeString(str);
IActiveScriptSite_Release(site);
init_registry(FALSE); init_registry(FALSE);
SET_EXPECT(Close); SET_EXPECT(Close);
...@@ -1077,6 +1083,9 @@ static void test_Reset(void) ...@@ -1077,6 +1083,9 @@ static void test_Reset(void)
ok(hr == S_OK, "got 0x%08x\n", hr); ok(hr == S_OK, "got 0x%08x\n", hr);
CHECK_CALLED(SetScriptState_INITIALIZED); CHECK_CALLED(SetScriptState_INITIALIZED);
CHECK_CALLED(SetScriptSite);
IActiveScriptSite_Release(site);
init_registry(FALSE); init_registry(FALSE);
SET_EXPECT(Close); SET_EXPECT(Close);
...@@ -1213,6 +1222,9 @@ static void test_AddObject(void) ...@@ -1213,6 +1222,9 @@ static void test_AddObject(void)
hr = IScriptControl_AddObject(sc, objname, &testdisp, VARIANT_TRUE); hr = IScriptControl_AddObject(sc, objname, &testdisp, VARIANT_TRUE);
ok(hr == E_INVALIDARG, "got 0x%08x\n", hr); ok(hr == E_INVALIDARG, "got 0x%08x\n", hr);
CHECK_CALLED(SetScriptSite);
IActiveScriptSite_Release(site);
init_registry(FALSE); init_registry(FALSE);
SET_EXPECT(Close); SET_EXPECT(Close);
......
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