diff --git a/dlls/mshtml/nsembed.c b/dlls/mshtml/nsembed.c
index a64f6a55510..ddd030a8ee9 100644
--- a/dlls/mshtml/nsembed.c
+++ b/dlls/mshtml/nsembed.c
@@ -1115,6 +1115,7 @@ static nsresult NSAPI nsSupportsWeakReference_GetWeakReference(nsISupportsWeakRe
TRACE("(%p)->(%p)\n", This, _retval);
+ nsIWeakReference_AddRef(NSWEAKREF(This));
*_retval = NSWEAKREF(This);
return NS_OK;
}
@@ -1230,23 +1231,13 @@ NSContainer *NSContainer_Create(HTMLDocument *doc, NSContainer *parent)
void NSContainer_Release(NSContainer *This)
{
- nsIBaseWindow *base_window;
- nsresult nsres;
-
TRACE("(%p)\n", This);
ShowWindow(This->hwnd, SW_HIDE);
SetParent(This->hwnd, NULL);
- nsres = nsIWebBrowser_QueryInterface(This->webbrowser, &IID_nsIBaseWindow,
- (void**)&base_window);
- if(NS_SUCCEEDED(nsres)) {
- nsIBaseWindow_SetVisibility(base_window, FALSE);
- nsIBaseWindow_Destroy(base_window);
- nsIBaseWindow_Release(base_window);
- }else {
- ERR("Could not get nsIBaseWindow interface: %08lx\n", nsres);
- }
+ nsIBaseWindow_SetVisibility(This->window, FALSE);
+ nsIBaseWindow_Destroy(This->window);
nsIWebBrowser_SetContainerWindow(This->webbrowser, NULL);
@@ -1259,6 +1250,9 @@ void NSContainer_Release(NSContainer *This)
nsIBaseWindow_Release(This->window);
This->window = NULL;
+ nsIWebBrowserFocus_Release(This->focus);
+ This->focus = NULL;
+
if(This->stream) {
nsIWebBrowserStream_Release(This->stream);
This->stream = NULL;
diff --git a/dlls/mshtml/nsio.c b/dlls/mshtml/nsio.c
index 51b3160504d..8af0bf5cb7f 100644
--- a/dlls/mshtml/nsio.c
+++ b/dlls/mshtml/nsio.c
@@ -131,14 +131,13 @@ static BOOL handle_uri(NSContainer *container, nsChannel *channel, LPCWSTR uri)
hres = IServiceProvider_QueryService(service_provider, &IID_IHlinkFrame,
&IID_IHlinkFrame, (void**)&hlink_frame);
+ IServiceProvider_Release(service_provider);
if(SUCCEEDED(hres)) {
hlink_frame_navigate(doc, hlink_frame, uri, channel->post_data_stream, hlnf);
IHlinkFrame_Release(hlink_frame);
return FALSE;
}
-
- IServiceProvider_Release(service_provider);
}
return TRUE;
@@ -618,6 +617,7 @@ static nsresult NSAPI nsChannel_AsyncOpen(nsIHttpChannel *iface, nsIStreamListen
nsres = nsIUploadChannel_SetUploadStream(upload_channel, This->post_data_stream,
&empty_string, -1);
+ nsIUploadChannel_Release(upload_channel);
if(NS_FAILED(nsres))
WARN("SetUploadStream failed: %08lx\n", nsres);