Don't use QMutexPool from the animation framework
Use a plain QBasicMutex instead Change-Id: I1abd35b4fe4e9f0401e73c7c3f503b00bba2baa9 Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>bb10
parent
38d566f713
commit
1e6514a714
|
|
@ -92,7 +92,7 @@
|
|||
#include "qanimationgroup.h"
|
||||
#include "qpropertyanimation_p.h"
|
||||
|
||||
#include <private/qmutexpool_p.h>
|
||||
#include <QtCore/QMutex>
|
||||
|
||||
#ifndef QT_NO_ANIMATION
|
||||
|
||||
|
|
@ -268,7 +268,8 @@ void QPropertyAnimation::updateState(QAbstractAnimation::State newState,
|
|||
QPropertyAnimation *animToStop = 0;
|
||||
{
|
||||
#ifndef QT_NO_THREAD
|
||||
QMutexLocker locker(QMutexPool::globalInstanceGet(&staticMetaObject));
|
||||
static QBasicMutex mutex;
|
||||
QMutexLocker locker(&mutex);
|
||||
#endif
|
||||
typedef QPair<QObject *, QByteArray> QPropertyAnimationPair;
|
||||
typedef QHash<QPropertyAnimationPair, QPropertyAnimation*> QPropertyAnimationHash;
|
||||
|
|
|
|||
|
|
@ -45,7 +45,6 @@
|
|||
#include <QtCore/qrect.h>
|
||||
#include <QtCore/qline.h>
|
||||
#include <QtCore/qmutex.h>
|
||||
#include <private/qmutexpool_p.h>
|
||||
|
||||
#ifndef QT_NO_ANIMATION
|
||||
|
||||
|
|
@ -399,6 +398,7 @@ void QVariantAnimation::setEasingCurve(const QEasingCurve &easing)
|
|||
|
||||
typedef QVector<QVariantAnimation::Interpolator> QInterpolatorVector;
|
||||
Q_GLOBAL_STATIC(QInterpolatorVector, registeredInterpolators)
|
||||
static QBasicMutex registeredInterpolatorsMutex;
|
||||
|
||||
/*!
|
||||
\fn void qRegisterAnimationInterpolator(QVariant (*func)(const T &from, const T &to, qreal progress))
|
||||
|
|
@ -435,9 +435,7 @@ void QVariantAnimation::registerInterpolator(QVariantAnimation::Interpolator fun
|
|||
// in such an order that we get here with interpolators == NULL,
|
||||
// to continue causes the app to crash on exit with a SEGV
|
||||
if (interpolators) {
|
||||
#ifndef QT_NO_THREAD
|
||||
QMutexLocker locker(QMutexPool::globalInstanceGet(interpolators));
|
||||
#endif
|
||||
QMutexLocker locker(®isteredInterpolatorsMutex);
|
||||
if (int(interpolationType) >= interpolators->count())
|
||||
interpolators->resize(int(interpolationType) + 1);
|
||||
interpolators->replace(interpolationType, func);
|
||||
|
|
@ -452,14 +450,14 @@ template<typename T> static inline QVariantAnimation::Interpolator castToInterpo
|
|||
|
||||
QVariantAnimation::Interpolator QVariantAnimationPrivate::getInterpolator(int interpolationType)
|
||||
{
|
||||
QInterpolatorVector *interpolators = registeredInterpolators();
|
||||
#ifndef QT_NO_THREAD
|
||||
QMutexLocker locker(QMutexPool::globalInstanceGet(interpolators));
|
||||
#endif
|
||||
QVariantAnimation::Interpolator ret = 0;
|
||||
if (interpolationType < interpolators->count()) {
|
||||
ret = interpolators->at(interpolationType);
|
||||
if (ret) return ret;
|
||||
{
|
||||
QInterpolatorVector *interpolators = registeredInterpolators();
|
||||
QMutexLocker locker(®isteredInterpolatorsMutex);
|
||||
QVariantAnimation::Interpolator ret = 0;
|
||||
if (interpolationType < interpolators->count()) {
|
||||
ret = interpolators->at(interpolationType);
|
||||
if (ret) return ret;
|
||||
}
|
||||
}
|
||||
|
||||
switch(interpolationType)
|
||||
|
|
|
|||
Loading…
Reference in New Issue