1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-07-04 23:55:26 +02:00

[fix] Test for display being not disposed in RSEWaitAndDispatchUtil.waitAndDispatch

This commit is contained in:
Uwe Stieber 2008-02-15 07:50:57 +00:00
parent ee8f64552c
commit 74e348e11e
2 changed files with 3 additions and 2 deletions

View file

@ -51,12 +51,12 @@ public final class RSEWaitAndDispatchUtil {
assert timeout > 0;
if (timeout > 0) {
long start = System.currentTimeMillis();
Display display = Display.findDisplay(Thread.currentThread());
final Display display = Display.findDisplay(Thread.currentThread());
if (display != null) {
// ok, we are running within a display thread --> keep the
// display event dispatching running.
long current = System.currentTimeMillis();
while ((current - start) < timeout) {
while ((current - start) < timeout && !display.isDisposed()) {
if (!display.readAndDispatch()) display.sleep();
current = System.currentTimeMillis();
}

View file

@ -203,6 +203,7 @@ public class TestSubsystemTestCase extends RSEBaseConnectionTestCase {
RSEWaitAndDispatchUtil.waitAndDispatch(10000);
}
catch (Exception e) {
e.printStackTrace();
assertNull(e.getMessage(), e);
}
}