Permalink
Browse files

Avoid QAtomicInt int cast.

This has been removed in qt5, and is easily avoided in Qt4.

Note in these cases the value is just being used for as a debugging aid,
in general any use of the implicit cast indicates a likely bug location.
  • Loading branch information...
1 parent 88d5348 commit 6800e4bd15101fd6a4a0d81ab5b3ea3eab8d7b22 @daniel-kristjansson daniel-kristjansson committed Dec 20, 2012
Showing with 3 additions and 2 deletions.
  1. +1 −1 mythtv/libs/libmythbase/referencecounter.cpp
  2. +2 −1 mythtv/libs/libmythui/mythuihelper.cpp
@@ -88,7 +88,7 @@ ReferenceCounter::ReferenceCounter(const QString &debugName, bool logDebug) :
ReferenceCounter::~ReferenceCounter(void)
{
- if (0 != m_referenceCount)
+ if (0 != m_referenceCount.fetchAndAddRelaxed(0))
{
LOG(VB_GENERAL, LOG_ERR,
"Object deleted with non-zero reference count!");
@@ -632,7 +632,8 @@ MythImage *MythUIHelper::CacheImage(const QString &url, MythImage *im,
LOG(VB_GUI | VB_FILE, LOG_INFO, LOC +
QString("MythUIHelper::CacheImage : Cache Count = :%1: size :%2:")
- .arg(d->imageCache.count()).arg(d->m_cacheSize));
+ .arg(d->imageCache.count())
+ .arg(d->m_cacheSize.fetchAndAddRelaxed(0)));
return d->imageCache[url];
}

0 comments on commit 6800e4b

Please sign in to comment.