Permalink
Browse files

Check if a registering thread is already registered

If it is, remove the old name and free it before adding the new one.
  • Loading branch information...
1 parent f2dd6f9 commit 2104fabe3c98a0a895567906ee9daf5f8de01e28 @Beirdo Beirdo committed Jun 21, 2012
Showing with 5 additions and 0 deletions.
  1. +5 −0 mythtv/libs/libmythbase/logging.cpp
View
5 mythtv/libs/libmythbase/logging.cpp
@@ -488,6 +488,11 @@ void LoggerThread::handleItem(LoggingItem *item)
item->m_tid = item->getThreadTid();
QMutexLocker locker(&logThreadMutex);
+ if (logThreadHash.contains(item->m_threadId))
+ {
+ char *threadName = logThreadHash.take(item->m_threadId);
+ free(threadName);
+ }
logThreadHash[item->m_threadId] = strdup(item->m_threadName);
if (debugRegistration)

0 comments on commit 2104fab

Please sign in to comment.