Skip to content

Commit

Permalink
DanmakuXXXViews: avoid ANR under some conditions
Browse files Browse the repository at this point in the history
  • Loading branch information
ctiao committed Nov 23, 2015
1 parent 5de3dea commit 83a9452
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -177,13 +177,14 @@ private void stopDraw() {
handler = null;
}
if (mHandlerThread != null) {
HandlerThread handlerThread = this.mHandlerThread;
mHandlerThread = null;
try {
mHandlerThread.join();
handlerThread.join();
} catch (InterruptedException e) {
e.printStackTrace();
}
mHandlerThread.quit();
mHandlerThread = null;
handlerThread.quit();
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -186,13 +186,14 @@ private void stopDraw() {
handler = null;
}
if (mHandlerThread != null) {
HandlerThread handlerThread = this.mHandlerThread;
mHandlerThread = null;
try {
mHandlerThread.join();
handlerThread.join();
} catch (InterruptedException e) {
e.printStackTrace();
}
mHandlerThread.quit();
mHandlerThread = null;
handlerThread.quit();
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -158,13 +158,14 @@ private void stopDraw() {
handler = null;
}
if (mHandlerThread != null) {
HandlerThread handlerThread = this.mHandlerThread;
mHandlerThread = null;
try {
mHandlerThread.join();
handlerThread.join();
} catch (InterruptedException e) {
e.printStackTrace();
}
mHandlerThread.quit();
mHandlerThread = null;
handlerThread.quit();
}
}

Expand Down

0 comments on commit 83a9452

Please sign in to comment.