Commit bfdaa330 authored by mjs's avatar mjs

Reviewed by Darin.

	- fixed 3144771 - Crash in KJS::WindowFunc::tryCall leaving www.smogcheck.org

	I fixed this by making sure we couldn't send the unload event twice, which was
	happening before in certain circumstances.

        * khtml/khtml_part.cpp:
        (KHTMLPart::closeURL): When emitting load event, note that unload
	event has not yet been sent.
        (KHTMLPart::checkEmitLoadEvent): Note when unload event has been
	sent to avoid sending it twice.
        * khtml/khtmlpart_p.h:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@3343 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 01106a97
2003-01-16 Maciej Stachowiak <mjs@apple.com>
Reviewed by Darin.
- fixed 3144771 - Crash in KJS::WindowFunc::tryCall leaving www.smogcheck.org
I fixed this by making sure we couldn't send the unload event twice, which was
happening before in certain circumstances.
* khtml/khtml_part.cpp:
(KHTMLPart::closeURL): When emitting load event, note that unload
event has not yet been sent.
(KHTMLPart::checkEmitLoadEvent): Note when unload event has been
sent to avoid sending it twice.
* khtml/khtmlpart_p.h:
2003-01-16 Darin Adler <darin@apple.com>
Reviewed by John.
......
2003-01-16 Maciej Stachowiak <mjs@apple.com>
Reviewed by Darin.
- fixed 3144771 - Crash in KJS::WindowFunc::tryCall leaving www.smogcheck.org
I fixed this by making sure we couldn't send the unload event twice, which was
happening before in certain circumstances.
* khtml/khtml_part.cpp:
(KHTMLPart::closeURL): When emitting load event, note that unload
event has not yet been sent.
(KHTMLPart::checkEmitLoadEvent): Note when unload event has been
sent to avoid sending it twice.
* khtml/khtmlpart_p.h:
2003-01-16 Darin Adler <darin@apple.com>
Reviewed by John.
......
......@@ -501,11 +501,11 @@ bool KHTMLPart::closeURL()
if ( d->m_doc && d->m_doc->isHTMLDocument() ) {
HTMLDocumentImpl* hdoc = static_cast<HTMLDocumentImpl*>( d->m_doc );
if ( hdoc->body() && d->m_bLoadEventEmitted ) {
if ( hdoc->body() && d->m_bLoadEventEmitted && !d->m_bUnloadEventEmitted ) {
hdoc->body()->dispatchWindowEvent( EventImpl::UNLOAD_EVENT, false, false );
if ( d->m_doc )
d->m_doc->updateRendering();
d->m_bLoadEventEmitted = false;
d->m_bUnloadEventEmitted = true;
}
}
......@@ -1715,6 +1715,7 @@ void KHTMLPart::checkEmitLoadEvent()
}
d->m_bLoadEventEmitted = true;
d->m_bUnloadEventEmitted = false;
if (d->m_doc)
d->m_doc->close();
}
......
......@@ -106,6 +106,7 @@ public:
m_job = 0L;
m_bComplete = true;
m_bLoadEventEmitted = true;
m_bUnloadEventEmitted = true;
m_cachePolicy = KIO::CC_Verify;
m_manager = 0L;
m_settings = new KHTMLSettings(*KHTMLFactory::defaultHTMLSettings());
......@@ -251,6 +252,7 @@ public:
bool m_bComplete:1;
bool m_bLoadEventEmitted:1;
bool m_bUnloadEventEmitted:1;
bool m_haveEncoding:1;
bool m_bHTTPRefresh:1;
bool m_onlyLocalReferences :1;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment