Skip to content
Snippets Groups Projects
Commit fd5a7a1b authored by Sébastien Blin's avatar Sébastien Blin Committed by Adrien Béraud
Browse files

data_transfer: emit in main thread

Some clients can try to get the data info in the DataTransferEvent's callback
this can provide a deadlock on infoMutex_. To prevent that, emitting the signal
on the main thread is necessary.

Change-Id: Ifca032e497272c3da9e2a866a23e4883a142d1e9
parent 6226bca1
Branches
Tags
No related merge requests found
...@@ -127,7 +127,9 @@ DataTransfer::emit(DRing::DataTransferEventCode code) const ...@@ -127,7 +127,9 @@ DataTransfer::emit(DRing::DataTransferEventCode code) const
} }
if (internalCompletionCb_) if (internalCompletionCb_)
return; // VCard transfer is just for the daemon return; // VCard transfer is just for the daemon
runOnMainThread([id = id, code]() {
emitSignal<DRing::DataTransferSignal::DataTransferEvent>(id, uint32_t(code)); emitSignal<DRing::DataTransferSignal::DataTransferEvent>(id, uint32_t(code));
});
} }
//============================================================================== //==============================================================================
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment