Commit 279dbf78 authored by Oksana Zhuravlova's avatar Oksana Zhuravlova Committed by Commit Bot

[mojo][bindings] Move Router exception to executor thread

This change moves throwing the exception if Router was not closed to the
executor thread to make it crash instead of just logging.

Bug: 1087098
Change-Id: I65c510bdbadedc3a0589807843c57e925c0351c5
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2321345Reviewed-by: default avatarBo <boliu@chromium.org>
Commit-Queue: Oksana Zhuravlova <oksamyt@chromium.org>
Cr-Commit-Position: refs/heads/master@{#800765}
parent 0e972cf1
...@@ -114,11 +114,12 @@ class AutoCloseableRouter implements Router { ...@@ -114,11 +114,12 @@ class AutoCloseableRouter implements Router {
@Override @Override
public void run() { public void run() {
close(); close();
throw new IllegalStateException(
"Warning: Router objects should be explicitly closed "
+ "when no longer required otherwise you may leak handles.",
mAllocationException);
} }
}); });
throw new IllegalStateException("Warning: Router objects should be explicitly closed "
+ "when no longer required otherwise you may leak handles.",
mAllocationException);
} }
super.finalize(); super.finalize();
} }
......
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