diff --git a/docshell/base/nsWebShell.cpp b/docshell/base/nsWebShell.cpp index 46affb4df2d1..34d12adbb857 100644 --- a/docshell/base/nsWebShell.cpp +++ b/docshell/base/nsWebShell.cpp @@ -4504,6 +4504,12 @@ NS_IMETHODIMP nsWebShell::AddChild(nsIDocShell *aChild) NS_ENSURE_SUCCESS(childmuDV->SetForceCharacterSet(forceCharset), NS_ERROR_FAILURE); } } + if (defaultCharset) { + Recycle(defaultCharset); + } + if (forceCharset) { + Recycle(forceCharset); + } } return NS_OK; diff --git a/webshell/src/nsWebShell.cpp b/webshell/src/nsWebShell.cpp index 46affb4df2d1..34d12adbb857 100644 --- a/webshell/src/nsWebShell.cpp +++ b/webshell/src/nsWebShell.cpp @@ -4504,6 +4504,12 @@ NS_IMETHODIMP nsWebShell::AddChild(nsIDocShell *aChild) NS_ENSURE_SUCCESS(childmuDV->SetForceCharacterSet(forceCharset), NS_ERROR_FAILURE); } } + if (defaultCharset) { + Recycle(defaultCharset); + } + if (forceCharset) { + Recycle(forceCharset); + } } return NS_OK;