Skip to content

Commit 989b35a

Browse files
committed
Fixed threading race condition
1 parent 4bbe2c3 commit 989b35a

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

Diff for: library/src/main/java/com/loopj/android/http/AsyncHttpResponseHandler.java

+4-4
Original file line numberDiff line numberDiff line change
@@ -322,11 +322,11 @@ protected void postRunnable(Runnable runnable) {
322322
boolean missingLooper = null == Looper.myLooper();
323323
if (runnable != null) {
324324
if (missingLooper) {
325-
// If there is no looper, run on current thread
326-
runnable.run();
327-
} else {
328-
// Otherwise, run on a handler we create
325+
// If there is no looper, run on provided handler
329326
handler.post(runnable);
327+
} else {
328+
// Otherwise, run on current thread
329+
runnable.run();
330330
}
331331
}
332332
}

0 commit comments

Comments
 (0)