diff options
author | Philip Langer | 2017-09-15 08:59:45 +0000 |
---|---|---|
committer | Laurent Goubet | 2018-05-01 12:28:07 +0000 |
commit | 02d8a005443368e42d60d5d8b413388b59a129d7 (patch) | |
tree | bf661b5342f81695c8ca4e6261c37a25173804fd | |
parent | 9122ab6c947ea30f940458ae041402faa7d6a187 (diff) | |
download | org.eclipse.emf.compare-02d8a005443368e42d60d5d8b413388b59a129d7.tar.gz org.eclipse.emf.compare-02d8a005443368e42d60d5d8b413388b59a129d7.tar.xz org.eclipse.emf.compare-02d8a005443368e42d60d5d8b413388b59a129d7.zip |
SWTUtil.safeRedraw should check for disposed control
If the redraw is executed asynchronously, it may happen that the control
is disposed before we call control.redraw().
Change-Id: I07b6349a6e21c228c3a421288c4bee99f7027ec6
Signed-off-by: Philip Langer <planger@eclipsesource.com>
-rw-r--r-- | plugins/org.eclipse.emf.compare.rcp.ui/src/org/eclipse/emf/compare/rcp/ui/internal/util/SWTUtil.java | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/plugins/org.eclipse.emf.compare.rcp.ui/src/org/eclipse/emf/compare/rcp/ui/internal/util/SWTUtil.java b/plugins/org.eclipse.emf.compare.rcp.ui/src/org/eclipse/emf/compare/rcp/ui/internal/util/SWTUtil.java index 381cc6d21..28becce16 100644 --- a/plugins/org.eclipse.emf.compare.rcp.ui/src/org/eclipse/emf/compare/rcp/ui/internal/util/SWTUtil.java +++ b/plugins/org.eclipse.emf.compare.rcp.ui/src/org/eclipse/emf/compare/rcp/ui/internal/util/SWTUtil.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2013, 2014 Obeo. + * Copyright (c) 2013, 2017 Obeo and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -7,6 +7,7 @@ * * Contributors: * Obeo - initial API and implementation + * Philip Langer - check if control is disposed before redraw *******************************************************************************/ package org.eclipse.emf.compare.rcp.ui.internal.util; @@ -97,7 +98,9 @@ public final class SWTUtil { public static void safeRedraw(final Control control, boolean async) { Runnable runnable = new Runnable() { public void run() { - control.redraw(); + if (!control.isDisposed()) { + control.redraw(); + } } }; if (async) { |