From: Henri Sara Date: Thu, 24 May 2012 13:16:02 +0000 (+0000) Subject: Manual merge from 6.7 to 6.8 for #8799 timer unregistration. X-Git-Tag: 7.0.0.alpha3~135^2~2 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=20ba0f58a0649702cfa5442d7c192c74d03b6a36;p=vaadin-framework.git Manual merge from 6.7 to 6.8 for #8799 timer unregistration. svn changeset:23825/svn branch:6.8 --- diff --git a/src/com/vaadin/terminal/gwt/client/ui/VView.java b/src/com/vaadin/terminal/gwt/client/ui/VView.java index 350c4b206b..6fdacc9607 100644 --- a/src/com/vaadin/terminal/gwt/client/ui/VView.java +++ b/src/com/vaadin/terminal/gwt/client/ui/VView.java @@ -136,7 +136,14 @@ public class VView extends SimplePanel implements Container, ResizeHandler, // should not be in the document focus flow getElement().setTabIndex(-1); TouchScrollDelegate.enableTouchScrolling(this, getElement()); + } + /** + * Start to periodically monitor for parent element resizes if embedded + * application (e.g. portlet). + */ + protected void onLoad() { + super.onLoad(); if (isMonitoringParentSize()) { resizeTimer = new Timer() { @Override @@ -151,6 +158,18 @@ public class VView extends SimplePanel implements Container, ResizeHandler, } } + /** + * Stop monitoring for parent element resizes. + */ + @Override + protected void onUnload() { + if (resizeTimer != null) { + resizeTimer.cancel(); + resizeTimer = null; + } + super.onUnload(); + } + /** * Called when the window or parent div might have been resized. *