Bug 752153 - Improve the exit procedure for the Gecko Android Looper r=blassey

--HG--
extra : rebase_source : 13bef9a232f076b883aab9ab1ef48f5e82f50a06
This commit is contained in:
James Willcox 2012-05-07 21:32:53 -04:00
parent cf54fe317e
commit d8a5119df7

View File

@ -2146,7 +2146,7 @@ public class GeckoAppShell
public static void pumpMessageLoop() {
// We're going to run the Looper below, but we need a way to break out, so
// we post this Runnable that throws a RuntimeException. This causes the loop
// we post this Runnable that throws an AssertionError. This causes the loop
// to exit without marking the Looper as dead. The Runnable is added to the
// end of the queue, so it will be executed after anything
// else that has been added prior.
@ -2157,13 +2157,13 @@ public class GeckoAppShell
// here we are.
sGeckoHandler.post(new Runnable() {
public void run() {
throw new RuntimeException();
throw new AssertionError();
}
});
try {
Looper.loop();
} catch(Exception ex) {}
} catch(Throwable ex) {}
}
static class AsyncResultHandler extends GeckoApp.FilePickerResultHandler {