All pastes #278305 Raw Edit

Untitled

public text v1 · immutable
·published 2006-12-13 23:38 UTC
rendered paste body
Index: dom/Document.cpp
===================================================================
--- dom/Document.cpp    (revision 18195)
+++ dom/Document.cpp    (working copy)
@@ -337,10 +337,12 @@
 
 Document::~Document()
 {
-    assert(!renderer());
-    assert(!m_inPageCache);
-    assert(m_savedRenderer == 0);
+    ASSERT(!renderer());
+    ASSERT(!m_inPageCache);
+    ASSERT(!m_savedRenderer);
 
+    removeAllEventListeners();
+
 #ifdef SVG_SUPPORT
     delete m_svgExtensions;
 #endif
@@ -3008,7 +3010,7 @@
 {
     Document *doc = const_cast<Document *>(this);
     Element *element;
-    while ((element = doc->ownerElement()) != 0)
+    while ((element = doc->ownerElement()))
         doc = element->document();
     
     return doc;