From a65806ef7b556b3b732b267abb5f30b09a5cfe61 Mon Sep 17 00:00:00 2001 From: "serge%netscape.com" Date: Thu, 11 Apr 2002 03:27:00 +0000 Subject: [PATCH] fix #94895, Flash movie is constantly stopped and restarted, r=peterl, sr=beard git-svn-id: svn://10.0.0.236/trunk@118712 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/layout/generic/nsObjectFrame.cpp | 17 +++++++++-------- mozilla/layout/html/base/src/nsObjectFrame.cpp | 17 +++++++++-------- .../plugin/base/src/ns4xPluginInstance.cpp | 10 +++++++--- 3 files changed, 25 insertions(+), 19 deletions(-) diff --git a/mozilla/layout/generic/nsObjectFrame.cpp b/mozilla/layout/generic/nsObjectFrame.cpp index da6adcdcd57..621fbd9fb2e 100644 --- a/mozilla/layout/generic/nsObjectFrame.cpp +++ b/mozilla/layout/generic/nsObjectFrame.cpp @@ -1196,10 +1196,6 @@ nsObjectFrame::InstantiatePlugin(nsIPresContext* aPresContext, window->clipRect.right = 0; #endif -#ifdef XP_UNIX - window->ws_info = nsnull; //XXX need to figure out what this is. MMP -#endif - // Check to see if content-policy wants to veto this if(aURI != nsnull) { @@ -1275,10 +1271,6 @@ nsObjectFrame::ReinstantiatePlugin(nsIPresContext* aPresContext, nsHTMLReflowMet window->clipRect.right = NSTwipsToIntPixels(aMetrics.width, t2p); #endif -#ifdef XP_UNIX - window->ws_info = nsnull; //XXX need to figure out what this is. MMP -#endif - return NS_OK; } @@ -2013,6 +2005,15 @@ nsPluginInstanceOwner::~nsPluginInstanceOwner() NS_IF_RELEASE(mWidget); mContext = nsnull; + +#ifdef XP_UNIX + // the mem for this struct is allocated + // by PR_MALLOC in ns4xPluginInstance.cpp:ns4xPluginInstance::SetWindow() + if (mPluginWindow.ws_info) { + PR_Free(mPluginWindow.ws_info); + mPluginWindow.ws_info = nsnull; + } +#endif } /* diff --git a/mozilla/layout/html/base/src/nsObjectFrame.cpp b/mozilla/layout/html/base/src/nsObjectFrame.cpp index da6adcdcd57..621fbd9fb2e 100644 --- a/mozilla/layout/html/base/src/nsObjectFrame.cpp +++ b/mozilla/layout/html/base/src/nsObjectFrame.cpp @@ -1196,10 +1196,6 @@ nsObjectFrame::InstantiatePlugin(nsIPresContext* aPresContext, window->clipRect.right = 0; #endif -#ifdef XP_UNIX - window->ws_info = nsnull; //XXX need to figure out what this is. MMP -#endif - // Check to see if content-policy wants to veto this if(aURI != nsnull) { @@ -1275,10 +1271,6 @@ nsObjectFrame::ReinstantiatePlugin(nsIPresContext* aPresContext, nsHTMLReflowMet window->clipRect.right = NSTwipsToIntPixels(aMetrics.width, t2p); #endif -#ifdef XP_UNIX - window->ws_info = nsnull; //XXX need to figure out what this is. MMP -#endif - return NS_OK; } @@ -2013,6 +2005,15 @@ nsPluginInstanceOwner::~nsPluginInstanceOwner() NS_IF_RELEASE(mWidget); mContext = nsnull; + +#ifdef XP_UNIX + // the mem for this struct is allocated + // by PR_MALLOC in ns4xPluginInstance.cpp:ns4xPluginInstance::SetWindow() + if (mPluginWindow.ws_info) { + PR_Free(mPluginWindow.ws_info); + mPluginWindow.ws_info = nsnull; + } +#endif } /* diff --git a/mozilla/modules/plugin/base/src/ns4xPluginInstance.cpp b/mozilla/modules/plugin/base/src/ns4xPluginInstance.cpp index c962a593f51..7e6257a6265 100644 --- a/mozilla/modules/plugin/base/src/ns4xPluginInstance.cpp +++ b/mozilla/modules/plugin/base/src/ns4xPluginInstance.cpp @@ -673,11 +673,15 @@ NS_IMETHODIMP ns4xPluginInstance::Stop(void) NPError error; #if defined(MOZ_WIDGET_GTK) - if (mXtBin) + if (mXtBin) { gtk_widget_destroy(mXtBin); + mXtBin = 0; + } #elif defined(MOZ_WIDGET_XLIB) - if (mXlibXtBin) + if (mXlibXtBin) { mXlibXtBin->xtbin_destroy(); + mXlibXtBin = 0; + } #endif if(!mStarted) @@ -838,7 +842,7 @@ NS_IMETHODIMP ns4xPluginInstance::SetWindow(nsPluginWindow* window) window->width, window->height, win); #endif -#if 1 +#if 0 // if we destroyed the plugin when we left the page, we could remove this // code (i believe) the problem here is that the window gets destroyed when // its parent, etc does by changing a page the plugin instance is being