Fix a possible recursive destructor call.
* page/Frame.cpp:
(WebCore::Frame::~Frame): Add a FIXME about cleaning up the destructor.
(WebCore::Frame::finishedParsing): Don't create a protector RefPtr if
we're already being destroyed.
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@16948
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2006-10-09 Adam Roben <aroben@apple.com>
+
+ Reviewed by Maciej.
+
+ Fix a possible recursive destructor call.
+
+ * page/Frame.cpp:
+ (WebCore::Frame::~Frame): Add a FIXME about cleaning up the destructor.
+ (WebCore::Frame::finishedParsing): Don't create a protector RefPtr if
+ we're already being destroyed.
+
2006-10-09 Sam Weinig <sam.weinig@gmail.com>
Reviewed by Tim H.
Frame::~Frame()
{
+ // FIXME: We should not be doing all this work inside the destructor
+
ASSERT(!d->m_lifeSupportTimer.isActive());
#ifndef NDEBUG
void Frame::finishedParsing()
{
- RefPtr<Frame> protector(this);
+ // This method can be called from our destructor, in which case we shouldn't protect ourselves
+ // because doing so will cause us to re-enter our destructor when protector goes out of scope.
+ RefPtr<Frame> protector = refCount() > 0 ? this : 0;
checkCompleted();
if (!d->m_view)