Potential fix for Android thread race condition

* Synchronous commands are on the stack, so incrementing the done flag should be
  the last thing we do to interact with them. That includes checking for self-
  deletion afterwards
This commit is contained in:
baldurk
2023-05-08 14:23:03 +01:00
parent 9a21a66f7c
commit 1f4e83986e
+6 -2
View File
@@ -894,10 +894,14 @@ struct AndroidController : public IDeviceProtocolHandler
cmd->meth();
Atomic::Inc32(&cmd->done);
if(cmd->selfdelete)
{
delete cmd;
}
else
{
Atomic::Inc32(&cmd->done);
}
}
}