DapService: avoid freezing Banshee when unmapping device (bgo#723040)
It could happen that a Map event generated a process that could take a while to detect the device, which would hold the DapService.sync lock, which is also used by the Unmap events, and the latter events run in the main thread, so this could mean that banshee gets frozen for a time as long as it takes to detect/connect to the device. To fix this we simply need to spawn a thread for the Unmap operation. This thread will later call ThreadAssist API again to come back to the main thread when the UI needs to be changed, but that's ok. On top of that, the Dispose() was actually being called outside this ThreadAssist.ProxyToMain() call, so it was generating bad gui-thread-check traces, so it's a good time to fix this as well.
parent
fd08a428
Please register or sign in to comment