Advertisement
Guest User

Untitled

a guest
Jan 26th, 2011
261
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Diff 1.75 KB | None | 0 0
  1. From 3031f1b1ebafe6dfdb99b4a745cac3f0887a8006 Mon Sep 17 00:00:00 2001
  2. From: Thiago Macieira <thiago.macieira@nokia.com>
  3. Date: Wed, 26 Jan 2011 14:06:11 +0100
  4. Subject: [PATCH] Check if the interpolators have already been deleted.
  5.  
  6. During application destruction, the order in which static destructors
  7. is run is undetermined. So avoid a null-pointer dereference.
  8.  
  9. Task-number: QTBUG-16855
  10. Reviewed-by: pending
  11. ---
  12. src/corelib/animation/qvariantanimation.cpp |   13 +++++++++----
  13.  1 files changed, 9 insertions(+), 4 deletions(-)
  14.  
  15. diff --git a/src/corelib/animation/qvariantanimation.cpp b/src/corelib/animation/qvariantanimation.cpp
  16. index 212e85d..c76cb89 100644
  17. --- a/src/corelib/animation/qvariantanimation.cpp
  18. +++ b/src/corelib/animation/qvariantanimation.cpp
  19. @@ -431,12 +431,17 @@ void QVariantAnimation::registerInterpolator(QVariantAnimation::Interpolator fun
  20.  {
  21.      // will override any existing interpolators
  22.      QInterpolatorVector *interpolators = registeredInterpolators();
  23. +    // When built on solaris with GCC, the destructors can be called
  24. +    // in such an order that we get here with interpolators == NULL,
  25. +    // to continue causes the app to crash on exit with a SEGV
  26. +    if (interpolators) {
  27.  #ifndef QT_NO_THREAD
  28. -    QMutexLocker locker(QMutexPool::globalInstanceGet(interpolators));
  29. +        QMutexLocker locker(QMutexPool::globalInstanceGet(interpolators));
  30.  #endif
  31. -    if (int(interpolationType) >= interpolators->count())
  32. -        interpolators->resize(int(interpolationType) + 1);
  33. -    interpolators->replace(interpolationType, func);
  34. +        if (int(interpolationType) >= interpolators->count())
  35. +            interpolators->resize(int(interpolationType) + 1);
  36. +        interpolators->replace(interpolationType, func);
  37. +    }
  38.  }
  39.  
  40.  
  41. --
  42. 1.7.3.2.431.ge2f5c
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement