tmf: Fix SWTException in TimeGraphCombo
authorPatrick Tasse <patrick.tasse@gmail.com>
Fri, 6 May 2016 19:07:41 +0000 (15:07 -0400)
committerPatrick Tasse <patrick.tasse@gmail.com>
Mon, 9 May 2016 14:48:57 +0000 (10:48 -0400)
The combo can get disposed while an async Runnable has been queued.

Change-Id: I942337d2ffcd34e9281f942a5a387058094386b0
Signed-off-by: Patrick Tasse <patrick.tasse@gmail.com>
Reviewed-on: https://git.eclipse.org/r/72209
Reviewed-by: Hudson CI
Reviewed-by: Bernd Hufmann <bernd.hufmann@ericsson.com>
Tested-by: Bernd Hufmann <bernd.hufmann@ericsson.com>
tmf/org.eclipse.tracecompass.tmf.ui/src/org/eclipse/tracecompass/tmf/ui/widgets/timegraph/TimeGraphCombo.java

index bc582af9140c3c0ee1fdb5869c5f36726a1ce245..b861f6ff288be9fef93db9f9271ba30a770dc4f1 100644 (file)
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2012, 2015 Ericsson, others
+ * Copyright (c) 2012, 2016 Ericsson, others
  *
  * All rights reserved. This program and the accompanying materials are
  * made available under the terms of the Eclipse Public License v1.0 which
@@ -189,6 +189,9 @@ public class TimeGraphCombo extends Composite {
                      * finished updating the item heights.
                      */
                     getDisplay().asyncExec(() -> {
+                        if (isDisposed()) {
+                            return;
+                        }
                         super.setElementPosition(entry, y);
                         alignTreeItems(false);
                     });
@@ -1029,6 +1032,9 @@ public class TimeGraphCombo extends Composite {
         getDisplay().asyncExec(new Runnable() {
             @Override
             public void run() {
+                if (isDisposed()) {
+                    return;
+                }
                 alignTreeItems(true);
             }
         });
This page took 0.031868 seconds and 5 git commands to generate.