From 2104fabe3c98a0a895567906ee9daf5f8de01e28 Mon Sep 17 00:00:00 2001 From: Gavin Hurlbut Date: Thu, 21 Jun 2012 10:53:32 -0700 Subject: [PATCH] Check if a registering thread is already registered If it is, remove the old name and free it before adding the new one. --- mythtv/libs/libmythbase/logging.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/mythtv/libs/libmythbase/logging.cpp b/mythtv/libs/libmythbase/logging.cpp index c05390146dd..4905822b848 100644 --- a/mythtv/libs/libmythbase/logging.cpp +++ b/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)