Fix usage of QMutexLocker, destroy it only at end of scope
Change-Id: I87f2c433c987b5f7b4680639cae51cdf6ce9ddc6 Reviewed-by: Marc Mutz <marc.mutz@kdab.com> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
This commit is contained in:
parent
e395bda9a5
commit
2c9f6b1a18
@ -165,7 +165,7 @@ QStringList QWindowsFileSystemWatcherEngine::addPaths(const QStringList &paths,
|
||||
// now look for a thread to insert
|
||||
bool found = false;
|
||||
foreach(QWindowsFileSystemWatcherEngineThread *thread, threads) {
|
||||
QMutexLocker(&(thread->mutex));
|
||||
QMutexLocker locker(&(thread->mutex));
|
||||
if (thread->handles.count() < MAXIMUM_WAIT_OBJECTS) {
|
||||
DEBUG() << "Added handle" << handle.handle << "for" << absolutePath << "to watch" << fileInfo.absoluteFilePath()
|
||||
<< "to existing thread " << thread;
|
||||
|
@ -737,7 +737,7 @@ inline QUrl QWindowsFileDialogSharedData::directory() const
|
||||
|
||||
inline void QWindowsFileDialogSharedData::setDirectory(const QUrl &d)
|
||||
{
|
||||
QMutexLocker (&m_data->mutex);
|
||||
QMutexLocker locker(&m_data->mutex);
|
||||
m_data->directory = d;
|
||||
}
|
||||
|
||||
@ -751,7 +751,7 @@ inline QString QWindowsFileDialogSharedData::selectedNameFilter() const
|
||||
|
||||
inline void QWindowsFileDialogSharedData::setSelectedNameFilter(const QString &f)
|
||||
{
|
||||
QMutexLocker (&m_data->mutex);
|
||||
QMutexLocker locker(&m_data->mutex);
|
||||
m_data->selectedNameFilter = f;
|
||||
}
|
||||
|
||||
@ -771,13 +771,13 @@ inline QString QWindowsFileDialogSharedData::selectedFile() const
|
||||
|
||||
inline void QWindowsFileDialogSharedData::setSelectedFiles(const QList<QUrl> &urls)
|
||||
{
|
||||
QMutexLocker (&m_data->mutex);
|
||||
QMutexLocker locker(&m_data->mutex);
|
||||
m_data->selectedFiles = urls;
|
||||
}
|
||||
|
||||
inline void QWindowsFileDialogSharedData::fromOptions(const QSharedPointer<QFileDialogOptions> &o)
|
||||
{
|
||||
QMutexLocker (&m_data->mutex);
|
||||
QMutexLocker locker(&m_data->mutex);
|
||||
m_data->directory = o->initialDirectory();
|
||||
m_data->selectedFiles = o->initiallySelectedFiles();
|
||||
m_data->selectedNameFilter = o->initiallySelectedNameFilter();
|
||||
|
Loading…
Reference in New Issue
Block a user