Open bzbarsky-apple opened 1 year ago
So if we get into this situation then:
CommandHandler::Handle
that has been captured by a block.Release()
on the handle.Looking at our uses of CommandHandler::Handle
, we have three:
MTROTAProviderDelegateBridge::HandleQueryImage
. In this case, I see the following ways we could fail to call Release()
:
asyncDispatchToMatterQueue
fails, in which case I am not sure what we could do here in practice...completionHandler
. Again, not really sure what we can do in that situation.MTROTAProviderDelegateBridge::HandleApplyUpdateRequest
. This has the same possible failure modes as HandleQueryImage
, as far as I can see.MTROTAProviderDelegateBridge::HandleNotifyUpdateApplied
. Same possible failure modes here.@ksperling-apple @nivi-apple anything I am missing here?
I guess for the "delegate never calls completionHandler
" case we could have an intermediate object that actually owns the handle and holds a ref to the controller and whose destructor tries to queue the handle release over to the controller....
Took a quick look. Looks like you covered all the use cases for MTROTAProviderDelegateBridge
@ksperling-apple ?
I am seeing crashes with stacks like so: