libbinder: RPC BinderNode erase checks asyncTodo
Recently, this code was changed to guarantee that no pending async
transactions can be deleted, but now it is explicitly checked when
we delete nodes.
Bug: 183140903
Test: binderRpcTest
Change-Id: I6aede64ef99c5464092448b54630fd3a7a43c9e1
diff --git a/libs/binder/RpcState.cpp b/libs/binder/RpcState.cpp
index 6e7088f..08bf4ec 100644
--- a/libs/binder/RpcState.cpp
+++ b/libs/binder/RpcState.cpp
@@ -813,6 +813,8 @@
ref = std::move(it->second.sentRef);
if (it->second.timesRecd == 0) {
+ LOG_ALWAYS_FATAL_IF(!it->second.asyncTodo.empty(),
+ "Can't delete binder w/ pending async transactions");
mNodeForAddress.erase(it);
}
}