From 8066a99ec5b104eea94838960c74415b101204cb Mon Sep 17 00:00:00 2001 From: Claudio Valerio Date: Tue, 22 May 2012 11:49:01 +0200 Subject: [PATCH] fixed issue with name on podcast list --- src/podcast/quicktime/UBAudioQueueRecorder.cpp | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/src/podcast/quicktime/UBAudioQueueRecorder.cpp b/src/podcast/quicktime/UBAudioQueueRecorder.cpp index 388a9a7f..f1cbef14 100644 --- a/src/podcast/quicktime/UBAudioQueueRecorder.cpp +++ b/src/podcast/quicktime/UBAudioQueueRecorder.cpp @@ -162,14 +162,10 @@ QString UBAudioQueueRecorder::deviceNameFromDeviceID(AudioDeviceID id) if (noErr == AudioDeviceGetProperty(id, 0, true, kAudioObjectPropertyName, &size, &name)) { - char *cname = new char[1024]; - - bool result = CFStringGetCString (name, cname, 1024, kCFStringEncodingUTF8); - int length = CFStringGetLength (name); - - deviceName = QString::fromUtf8(cname, length); - - delete cname; + char cname[1024]; + memset(cname,0,1024); + CFStringGetCString (name, cname, 1024, kCFStringEncodingUTF8); + deviceName = QString::fromUtf8(cname); } CFRelease(name);