void BlobResourceHandle::notifyFinish() { if (!m_async) { doNotifyFinish(*this); return; } // Schedule to notify the client from a standalone function because the client might dispose the handle immediately from the callback function // while we still have BlobResourceHandle calls in the stack. callOnMainThread([protectedThis = Ref<BlobResourceHandle>(*this)]() mutable { doNotifyFinish(protectedThis); }); }
void BlobResourceHandle::notifyFinish() { if (!m_async) { doNotifyFinish(*this); return; } // Schedule to notify the client from a standalone function because the client might dispose the handle immediately from the callback function // while we still have BlobResourceHandle calls in the stack. RefPtr<BlobResourceHandle> handle(this); callOnMainThread([handle] { doNotifyFinish(*handle); }); }
void BlobResourceHandle::notifyFinish() { if (m_async) { // Schedule to notify the client from a standalone function because the client might dispose the handle immediately from the callback function // while we still have BlobResourceHandle calls in the stack. callOnMainThread(doNotifyFinish, this); return; } doNotifyFinish(this); }