[webkit-dev] Frame and FrameView references

Artem Ananiev Artem.Ananiev at Sun.COM
Fri Feb 29 04:25:42 PST 2008


Hi, all,

I have noticed the following strange code in Frame class:

Frame::~Frame()
{
     setView(0);
     ...
     if (d->m_view) {
         d->m_view->hide();
         d->m_view->clearFrame();
     }
     ...
}

It is clear that the latter statements are never executed as d->m_view 
is always NULL after setView(0). Then, I tried moving 'if' statement to 
the very top of the method, but this didn't helped as setView(0) is 
called every time before destructor.

I have also searched for all the places where m_frame field in FrameView 
class is changed. Only two lines were found: in FrameView constructor 
and in clearFrame(). As clearFrame() is never called, I get an outdated 
reference to an instance of Frame in FrameView which results in a crash. 
The frame view can't even be deleted as its destructor contains some 
calls to m_frame object...

How this situation is supposed to be handled?

Thanks,

Artem


More information about the webkit-dev mailing list