diff --git a/mozilla/layout/generic/nsObjectFrame.cpp b/mozilla/layout/generic/nsObjectFrame.cpp index 5ff72689ab6..bf694f597c6 100644 --- a/mozilla/layout/generic/nsObjectFrame.cpp +++ b/mozilla/layout/generic/nsObjectFrame.cpp @@ -3256,6 +3256,9 @@ nsPluginInstanceOwner::Destroy() else NS_ASSERTION(PR_FALSE, "plugin was not an event listener"); } else NS_ASSERTION(PR_FALSE, "plugin had no content"); + + mOwner = nsnull; // break relationship between frame and plugin instance owner + return NS_OK; } diff --git a/mozilla/layout/html/base/src/nsObjectFrame.cpp b/mozilla/layout/html/base/src/nsObjectFrame.cpp index 5ff72689ab6..bf694f597c6 100644 --- a/mozilla/layout/html/base/src/nsObjectFrame.cpp +++ b/mozilla/layout/html/base/src/nsObjectFrame.cpp @@ -3256,6 +3256,9 @@ nsPluginInstanceOwner::Destroy() else NS_ASSERTION(PR_FALSE, "plugin was not an event listener"); } else NS_ASSERTION(PR_FALSE, "plugin had no content"); + + mOwner = nsnull; // break relationship between frame and plugin instance owner + return NS_OK; } diff --git a/mozilla/modules/plugin/base/src/nsPluginHostImpl.cpp b/mozilla/modules/plugin/base/src/nsPluginHostImpl.cpp index 33fce7f4a5e..478873058cf 100644 --- a/mozilla/modules/plugin/base/src/nsPluginHostImpl.cpp +++ b/mozilla/modules/plugin/base/src/nsPluginHostImpl.cpp @@ -1783,10 +1783,19 @@ nsPluginStreamListenerPeer::OnStartRequest(nsIRequest *request, nsISupports* aCo mHaveFiredOnStartRequest = PR_TRUE; - nsCOMPtr channel = do_QueryInterface(request); + // do a little sanity check to make sure our frame isn't gone + // by getting the tag type and checking for an error, we can determine if + // the frame is gone + if (mOwner) { + nsCOMPtr pti2 = do_QueryInterface(mOwner); + NS_ENSURE_TRUE(pti2, NS_ERROR_FAILURE); + nsPluginTagType tagType; + if (NS_FAILED(pti2->GetTagType(&tagType))) + return NS_ERROR_FAILURE; // something happened to our object frame, so bail! + } - if (!channel) - return NS_ERROR_FAILURE; + nsCOMPtr channel = do_QueryInterface(request); + NS_ENSURE_TRUE(channel, NS_ERROR_FAILURE); nsCOMPtr cacheChannel = do_QueryInterface(channel, &rv); if (cacheChannel)