[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: [Amarok] e50149e: Fix possible crash in debugging system
From: Kevin Funk <krf () electrostorm ! net>
Date: 2010-11-13 20:43:05
Message-ID: 20101113204305.4D3BBA60AA () git ! kde ! org
[Download RAW message or body]
commit e50149e9ef903b54f5b69105cc424351938d94c3
branch master
Author: Kevin Funk <krf@electrostorm.net>
Date: Sat Nov 13 21:37:52 2010 +0100
Fix possible crash in debugging system
Do not hold a reference to a shared resource after leaving the critical
region.
Thanks for the good catch, Rick.
diff --git a/src/core/support/Debug.cpp b/src/core/support/Debug.cpp
index 83fdccd..6faebb3 100644
--- a/src/core/support/Debug.cpp
+++ b/src/core/support/Debug.cpp
@@ -33,7 +33,7 @@
// Define Application wide prefix
#ifndef APP_PREFIX
-#define APP_PREFIX QLatin1String( "amarok" )
+#define APP_PREFIX QLatin1String( "amarok:" )
#endif
#define DEBUG_INDENT_OBJECTNAME QLatin1String("Debug_Indent_object")
@@ -97,7 +97,7 @@ static QString reverseColorize( const QString &text, int color )
return QString( "\x1b[07;3%1m%2\x1b[00;39m" ).arg( QString::number(color), text );
}
-const QString& Debug::indent()
+QString Debug::indent()
{
return IndentPrivate::instance()->m_string;
}
@@ -128,7 +128,7 @@ kdbgstream Debug::dbgstream( DebugLevel level )
return kDebugDevNull();
mutex.lock();
- const QString ¤tIndent = indent();
+ const QString currentIndent = indent();
mutex.unlock();
QString text = QString("%1%2")
diff --git a/src/core/support/Debug.h b/src/core/support/Debug.h
index ec302cf..ce1056e 100644
--- a/src/core/support/Debug.h
+++ b/src/core/support/Debug.h
@@ -90,7 +90,7 @@ namespace Debug
AMAROK_CORE_EXPORT bool debugColorEnabled();
AMAROK_CORE_EXPORT void setDebugEnabled( bool enable );
AMAROK_CORE_EXPORT void setColoredDebug( bool enable );
- AMAROK_CORE_EXPORT const QString &indent();
+ AMAROK_CORE_EXPORT QString indent();
static inline kdbgstream dbgstreamwrapper( DebugLevel level ) {
#ifdef DEBUG_PREFIX
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic