Skip to content

Commit

Permalink
Check if a registering thread is already registered
Browse files Browse the repository at this point in the history
If it is, remove the old name and free it before adding the new one.
  • Loading branch information
Beirdo committed Jun 21, 2012
1 parent f2dd6f9 commit 2104fab
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions mythtv/libs/libmythbase/logging.cpp
Expand Up @@ -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)
Expand Down

0 comments on commit 2104fab

Please sign in to comment.