Reviewed by John.
[WebKit-https.git] / WebCore / khtml / khtml_part.cpp
index de2f5964150a74df54b2b70b14c83f3f35e2d1c5..edcb507e7297d8373e840312f69d81aa6d218a9a 100644 (file)
@@ -608,6 +608,9 @@ bool KHTMLPart::closeURL()
       d->m_bUnloadEventEmitted = true;
     }
   }
+
+  if (d->m_doc && !d->m_doc->inPageCache())
+    d->m_doc->removeAllEventListenersFromAllNodes();
     
   d->m_bComplete = true; // to avoid emitting completed() in slotFinishedParsing() (David)
   d->m_bLoadingMainResource = false;