WebCore:
[WebKit-https.git] / WebCore / html / HTMLInputElement.cpp
index 13834fa91638d1ad0f0c55b3da00a62ca1263623..dca77aa1a02c10cbe511c767df219e7546c6d802 100644 (file)
@@ -144,8 +144,12 @@ HTMLInputElement::~HTMLInputElement()
         document()->unregisterForCacheCallbacks(this);
 
     document()->checkedRadioButtons().removeButton(this);
-    
+
     delete m_imageLoader;
+
+    // Need to remove this from the form while it is still an HTMLInputElement,
+    // so can't wait for the base class's destructor to do it.
+    removeFromForm();
 }
 
 const AtomicString& HTMLInputElement::name() const