Reviewed by Adam.
http://bugzilla.opendarwin.org/show_bug.cgi?id=10838
Bug 10838: REGRESSION: Leaking of WebScriptObjectPrivate
FrameMac relies on its cleanupPluginObjects being called to perform cleanup. The virtual
Frame::cleanupPluginObjects method is called from Frame's destructor, which results
in Frame::cleanupPluginObjects being called rather than FrameMac::cleanupPluginObjects.
* bridge/mac/FrameMac.mm:
(WebCore::FrameMac::~FrameMac): Call cancelAndClear to ensure that FrameMac::cleanupPluginObjects
will be called from Frame::clear
* page/Frame.cpp:
(WebCore::Frame::~Frame): Use cancelAndClear.
(WebCore::Frame::cancelAndClear): Move cancellation and clearing into a separate method that
FrameMac can use.
* page/Frame.h:
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@16368
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2006-09-14 Mark Rowe <opendarwin.org@bdash.net.nz>
+
+ Reviewed by Adam.
+
+ http://bugzilla.opendarwin.org/show_bug.cgi?id=10838
+ Bug 10838: REGRESSION: Leaking of WebScriptObjectPrivate
+
+ FrameMac relies on its cleanupPluginObjects being called to perform cleanup. The virtual
+ Frame::cleanupPluginObjects method is called from Frame's destructor, which results
+ in Frame::cleanupPluginObjects being called rather than FrameMac::cleanupPluginObjects.
+
+ * bridge/mac/FrameMac.mm:
+ (WebCore::FrameMac::~FrameMac): Call cancelAndClear to ensure that FrameMac::cleanupPluginObjects
+ will be called from Frame::clear
+ * page/Frame.cpp:
+ (WebCore::Frame::~Frame): Use cancelAndClear.
+ (WebCore::Frame::cancelAndClear): Move cancellation and clearing into a separate method that
+ FrameMac can use.
+ * page/Frame.h:
+
2006-09-14 Brady Eidson <beidson@apple.com>
Reviewed by Maciej's rubber stamp
[_bridge clearFrame];
HardRelease(_bridge);
_bridge = nil;
+
+ cancelAndClear();
}
void FrameMac::freeClipboard()
--FrameCounter::count;
#endif
- cancelRedirection();
-
- if (!d->m_bComplete)
- closeURL();
-
- clear(false);
+ cancelAndClear();
if (d->m_jscript && d->m_jscript->haveInterpreter())
if (Window* w = Window::retrieveWindow(this)) {
return true;
}
+void Frame::cancelAndClear()
+{
+ cancelRedirection();
+
+ if (!d->m_bComplete)
+ closeURL();
+
+ clear(false);
+}
+
void Frame::clear(bool clearWindowProperties)
{
if (d->m_bCleared)
virtual void startRedirectionTimer();
virtual void stopRedirectionTimer();
virtual void cleanupPluginObjects() { }
+ void cancelAndClear();
void handleAutoscroll(RenderLayer*);
void startAutoscrollTimer();