Skip to content

Commit b4040ed

Browse files
committed
fix: timers removed from wrong looper
1 parent 27f577f commit b4040ed

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

test-app/runtime/src/main/cpp/Timers.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -186,8 +186,9 @@ void Timers::Destroy() {
186186
bufferFull.notify_one();
187187
taskReady.notify_all();
188188
watcher_.join();
189-
auto mainLooper = Runtime::GetMainLooper();
190-
ALooper_removeFd(mainLooper, fd_[0]);
189+
// remove the fd from this instance's looper - on worker threads this is
190+
// the worker looper, not the main one
191+
ALooper_removeFd(looper_, fd_[0]);
191192
close(fd_[0]);
192193
timerMap_.clear();
193194
ALooper_release(looper_);

0 commit comments

Comments
 (0)