mirror of
https://github.com/clementine-player/Clementine
synced 2024-12-14 18:35:16 +01:00
Lock access to WMDM devices
This commit is contained in:
parent
034555942b
commit
c9e5a3dce7
@ -55,11 +55,15 @@ void WmdmDevice::Init() {
|
||||
connect(loader_, SIGNAL(LoadFinished()), SLOT(LoadFinished()));
|
||||
connect(loader_thread_, SIGNAL(started()), loader_, SLOT(LoadDatabase()));
|
||||
loader_thread_->start();
|
||||
|
||||
db_busy_.lock();
|
||||
}
|
||||
|
||||
void WmdmDevice::LoadFinished() {
|
||||
loader_->deleteLater();
|
||||
loader_ = NULL;
|
||||
|
||||
db_busy_.unlock();
|
||||
}
|
||||
|
||||
bool WmdmDevice::StartCopy(QList<Song::FileType>* supported_types) {
|
||||
@ -263,6 +267,8 @@ bool WmdmDevice::GetSupportedFiletypes(QList<Song::FileType>* ret, IWMDMDevice*
|
||||
}
|
||||
|
||||
bool WmdmDevice::GetSupportedFiletypes(QList<Song::FileType>* ret) {
|
||||
QMutexLocker l(&db_busy_);
|
||||
|
||||
WmdmThread thread;
|
||||
|
||||
// Get the device
|
||||
|
Loading…
Reference in New Issue
Block a user