+2006-09-12 Anders Carlsson <acarlsson@apple.com>
+
+ Reviewed by John Sullivan.
+
+ Do the plugin object cleanup in Frame::clear instead of setView.
+
+ * bridge/mac/FrameMac.h:
+ * bridge/mac/FrameMac.mm:
+ (WebCore::FrameMac::setView):
+ (WebCore::FrameMac::cleanupPluginObjects):
+ * page/Frame.cpp:
+ (WebCore::Frame::clear):
+ * page/Frame.h:
+
2006-09-12 MorganL <morlmor@yahoo.com>
Reviewed/landed by aroben.
virtual KJS::Bindings::Instance* getObjectInstanceForWidget(Widget*);
virtual KJS::Bindings::Instance* getAppletInstanceForWidget(Widget*);
void addPluginRootObject(KJS::Bindings::RootObject* root);
- void cleanupPluginRootObjects();
virtual void registerCommandForUndo(PassRefPtr<EditCommand>);
virtual void registerCommandForRedo(PassRefPtr<EditCommand>);
protected:
virtual void startRedirectionTimer();
virtual void stopRedirectionTimer();
-
+ virtual void cleanupPluginObjects();
+
private:
virtual void handleMousePressEvent(const MouseEventWithHitTestResults&);
virtual void handleMouseMoveEvent(const MouseEventWithHitTestResults&);
d->m_view = view;
- // Delete old PlugIn data structures
- cleanupPluginRootObjects();
- _bindingRoot = 0;
- HardRelease(_windowScriptObject);
- _windowScriptObject = 0;
-
- if (_windowScriptNPObject) {
- // Call _NPN_DeallocateObject() instead of _NPN_ReleaseObject() so that we don't leak if a plugin fails to release the window
- // script object properly.
- // This shouldn't cause any problems for plugins since they should have already been stopped and destroyed at this point.
- _NPN_DeallocateObject(_windowScriptNPObject);
- _windowScriptNPObject = 0;
- }
-
// Only one form submission is allowed per view of a part.
// Since this part may be getting reused as a result of being
// pulled from the back/forward cache, reset this flag.
m_rootObjects.append(root);
}
-void FrameMac::cleanupPluginRootObjects()
+void FrameMac::cleanupPluginObjects()
{
+ // Delete old plug-in data structures
JSLock lock;
-
+
unsigned count = m_rootObjects.size();
for (unsigned i = 0; i < count; i++)
m_rootObjects[i]->removeAllNativeReferences();
m_rootObjects.clear();
+
+ _bindingRoot = 0;
+ HardRelease(_windowScriptObject);
+ _windowScriptObject = 0;
+
+ if (_windowScriptNPObject) {
+ // Call _NPN_DeallocateObject() instead of _NPN_ReleaseObject() so that we don't leak if a plugin fails to release the window
+ // script object properly.
+ // This shouldn't cause any problems for plugins since they should have already been stopped and destroyed at this point.
+ _NPN_DeallocateObject(_windowScriptNPObject);
+ _windowScriptNPObject = 0;
+ }
}
void FrameMac::registerCommandForUndoOrRedo(PassRefPtr<EditCommand> cmd, bool isRedo)