extragear/multimedia/amarok/src
Jeff Mitchell
kde-dev at emailgoeshere.com
Wed Aug 1 11:58:00 CEST 2007
Mark Kretschmann wrote:
> On 7/31/07, Jeff Mitchell <kde-dev at emailgoeshere.com> wrote:
>
>> SVN commit 694773 by mitchell:
>>
>> Attempt to fix breakage from new kdelibs
>>
>>
>> M +4 -4 debug.h
>>
>>
>> --- trunk/extragear/multimedia/amarok/src/debug.h #694772:694773
>> @@ -104,10 +104,10 @@
>> KDEBUG_FATAL = 3
>> };
>>
>> - static inline kdbgstream debug() { mutex.lock(); QByteArray ind = indent(); mutex.unlock(); return kdbgstream( ind.data(), 0, KDEBUG_INFO ) << AMK_PREFIX; }
>> - static inline kdbgstream warning() { mutex.lock(); QByteArray ind = indent(); mutex.unlock(); return kdbgstream( ind.data(), 0, KDEBUG_WARN ) << AMK_PREFIX << "[WARNING!] "; }
>> - static inline kdbgstream error() { mutex.lock(); QByteArray ind = indent(); mutex.unlock(); return kdbgstream( ind.data(), 0, KDEBUG_ERROR ) << AMK_PREFIX << "[ERROR!] "; }
>> - static inline kdbgstream fatal() { mutex.lock(); QByteArray ind = indent(); mutex.unlock(); return kdbgstream( ind.data(), 0, KDEBUG_FATAL ) << AMK_PREFIX; }
>> + static inline kdbgstream debug() { mutex.lock(); QByteArray ind = indent(); mutex.unlock(); return kdbgstream( new QString( ind.data() + KDEBUG_INFO ) ) << AMK_PREFIX; }
>> + static inline kdbgstream warning() { mutex.lock(); QByteArray ind = indent(); mutex.unlock(); return kdbgstream( new QString( ind.data() + KDEBUG_WARN ) ) << AMK_PREFIX << "[WARNING!] "; }
>> + static inline kdbgstream error() { mutex.lock(); QByteArray ind = indent(); mutex.unlock(); return kdbgstream( new QString( ind.data() + KDEBUG_ERROR ) ) << AMK_PREFIX << "[ERROR!] "; }
>> + static inline kdbgstream fatal() { mutex.lock(); QByteArray ind = indent(); mutex.unlock(); return kdbgstream( new QString( ind.data() + KDEBUG_FATAL ) ) << AMK_PREFIX; }
>>
>> typedef kdbgstream DebugStream;
>>
>
> Looks like this is leaking one QString per debug statement.
>
>
I'm not sure it's leaking anything - I tried passing a reference to a
QString and compilation threw a warning because it was using the address
of a temporary variable. But it'll no longer accept a const char *. So
perhaps the new kdebug code deletes the QString when done with it.
I don't really know as I haven't looked inside the code, and as Leo
pointed out yesterday, it doesn't work anyways. It just compiles.
--Jeff
More information about the Amarok-devel
mailing list