Summary: | [site-issue] Segmentation fault after deleting messages in gmail site | ||
---|---|---|---|
Product: | [Applications] konqueror | Reporter: | 81joe81 |
Component: | general | Assignee: | Konqueror Developers <konq-bugs> |
Status: | RESOLVED FIXED | ||
Severity: | crash | ||
Priority: | NOR | ||
Version: | unspecified | ||
Target Milestone: | --- | ||
Platform: | Ubuntu | ||
OS: | Linux | ||
Latest Commit: | Version Fixed In: | ||
Sentry Crash Report: |
Description
81joe81
2006-03-27 09:55:07 UTC
SVN commit 599857 by orlovich: Prevent crash-inducing recursion of detach due to blur events happening when widgets with focus get destroyed, by quietly shifting the focus to the view...(#135384, probably #124342 --- best I can tell given imperfect information); also affects some bugs which I separately closed as non-reproducible, but which involved such a sequence Also fixes freezing in #92497, as we no longer try to find something to focus when nothing is focusable.. BUG:92497 BUG:124342 BUG:135384 M +9 -0 khtmlview.cpp M +14 -3 xml/dom_docimpl.cpp --- branches/KDE/3.5/kdelibs/khtml/khtmlview.cpp #599856:599857 @@ -2031,6 +2031,15 @@ DocumentImpl *doc = m_part->xmlDocImpl(); NodeImpl *oldFocusNode = doc->focusNode(); + + // See whether we're in the middle of detach. If so, we want to + // clear focus... The document code will be careful to not + // emit events in that case.. + if (oldFocusNode && oldFocusNode->renderer() && + !oldFocusNode->renderer()->parent()) { + doc->setFocusNode(0); + return true; + } #if 1 // If the user has scrolled the document, then instead of picking --- branches/KDE/3.5/kdelibs/khtml/xml/dom_docimpl.cpp #599856:599857 @@ -2227,6 +2227,13 @@ { // don't process focus changes while detaching if( !m_render ) return; + + // We do want to blur if a widget is being detached, + // but we don't want to emit events since that + // triggers updateLayout() and may recurse detach() + bool widgetDetach = m_focusNode && m_focusNode != this && + m_focusNode->renderer() && !m_focusNode->renderer()->parent(); + // Make sure newFocusNode is actually in this document if (newFocusNode && (newFocusNode->getDocument() != this)) return; @@ -2241,8 +2248,11 @@ oldFocusNode->setActive(false); oldFocusNode->setFocus(false); - oldFocusNode->dispatchHTMLEvent(EventImpl::BLUR_EVENT,false,false); - oldFocusNode->dispatchUIEvent(EventImpl::DOMFOCUSOUT_EVENT); + + if (!widgetDetach) { + oldFocusNode->dispatchHTMLEvent(EventImpl::BLUR_EVENT,false,false); + oldFocusNode->dispatchUIEvent(EventImpl::DOMFOCUSOUT_EVENT); + } if ((oldFocusNode == this) && oldFocusNode->hasOneRef()) { oldFocusNode->deref(); // deletes this return; @@ -2278,7 +2288,8 @@ view()->setFocus(); } - updateRendering(); + if (!widgetDetach) + updateRendering(); } } |