Kaydet (Commit) 90f7a3ad authored tarafından Michael Stahl's avatar Michael Stahl

OfficeConnection.java: don't wait forever if terminate() fails

üst 56665a8a
...@@ -128,6 +128,12 @@ public final class OfficeConnection { ...@@ -128,6 +128,12 @@ public final class OfficeConnection {
context = null; context = null;
try { try {
desktopTerminated = desktop.terminate(); desktopTerminated = desktop.terminate();
if (!desktopTerminated) {
// in case terminate() fails we would wait forever
// for the process to die, so kill it
process.destroy();
}
assertTrue(desktopTerminated);
} catch (DisposedException e) {} } catch (DisposedException e) {}
// it appears that DisposedExceptions can already happen // it appears that DisposedExceptions can already happen
// while receiving the response of the terminate call // while receiving the response of the terminate call
...@@ -142,7 +148,6 @@ public final class OfficeConnection { ...@@ -142,7 +148,6 @@ public final class OfficeConnection {
} }
boolean outTerminated = outForward == null || outForward.terminated(); boolean outTerminated = outForward == null || outForward.terminated();
boolean errTerminated = errForward == null || errForward.terminated(); boolean errTerminated = errForward == null || errForward.terminated();
assertTrue(desktopTerminated);
assertEquals(0, code); assertEquals(0, code);
assertTrue(outTerminated); assertTrue(outTerminated);
assertTrue(errTerminated); assertTrue(errTerminated);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment