]> source.dussan.org Git - vaadin-framework.git/commitdiff
Remove widget if it is still in the DOM when connector is unregistered
authorArtur Signell <artur@vaadin.com>
Tue, 17 Apr 2012 19:04:27 +0000 (22:04 +0300)
committerArtur Signell <artur@vaadin.com>
Wed, 18 Apr 2012 20:08:56 +0000 (23:08 +0300)
src/com/vaadin/terminal/gwt/client/ui/AbstractComponentConnector.java

index 2458a27eac6fe8d85cb9f3367014dd3e7e851d04..a56f5f552526d8691776598b8f5c79c857d3a465 100644 (file)
@@ -338,12 +338,13 @@ public abstract class AbstractComponentConnector extends AbstractConnector
     public void onUnregister() {
         super.onUnregister();
 
-        // Warn if widget is still attached to DOM. It should never be at this
-        // point.
+        // Show an error if widget is still attached to DOM. It should never be
+        // at this point.
         if (getWidget() != null && getWidget().isAttached()) {
-            VConsole.log("Widget for unregistered connector "
+            getWidget().removeFromParent();
+            VConsole.error("Widget is still attached to the DOM after the connector ("
                     + Util.getConnectorString(this)
-                    + " is still attached to the DOM.");
+                    + ") has been unregistered. Widget was removed.");
         }
     }
 }