diff options
author | Justin McPherson <justin.mcpherson@nokia.com> | 2010-04-20 02:00:48 (GMT) |
---|---|---|
committer | Justin McPherson <justin.mcpherson@nokia.com> | 2010-04-20 02:07:24 (GMT) |
commit | 537594d794c9e5eb379e4a099781b4857e91cd68 (patch) | |
tree | cadcec83362cd3678af39addaaf091ec04bfab66 /src/plugins | |
parent | 58d509da551595d2a3e49de9f8b01b0206723d01 (diff) | |
download | Qt-537594d794c9e5eb379e4a099781b4857e91cd68.zip Qt-537594d794c9e5eb379e4a099781b4857e91cd68.tar.gz Qt-537594d794c9e5eb379e4a099781b4857e91cd68.tar.bz2 |
QT7 mediaservice; fix leaking strings.
Reviewed-by: Dmytro Poplavskiy
Diffstat (limited to 'src/plugins')
-rw-r--r-- | src/plugins/mediaservices/qt7/mediaplayer/qt7playersession.mm | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/src/plugins/mediaservices/qt7/mediaplayer/qt7playersession.mm b/src/plugins/mediaservices/qt7/mediaplayer/qt7playersession.mm index 024f7b0..0405bbd 100644 --- a/src/plugins/mediaservices/qt7/mediaplayer/qt7playersession.mm +++ b/src/plugins/mediaservices/qt7/mediaplayer/qt7playersession.mm @@ -153,10 +153,9 @@ QT_BEGIN_NAMESPACE -static CFStringRef qString2CFStringRef(const QString &string) +static inline NSString *qString2CFStringRef(const QString &string) { - return CFStringCreateWithCharacters(0, reinterpret_cast<const UniChar *>(string.unicode()), - string.length()); + return [NSString stringWithCharacters:reinterpret_cast<const UniChar *>(string.unicode()) length:string.length()]; } QT7PlayerSession::QT7PlayerSession(QObject *parent) @@ -391,10 +390,10 @@ void QT7PlayerSession::setMedia(const QMediaContent &content, QIODevice *stream) foreach (const QNetworkCookie &requestCookie, cookieList) { NSMutableDictionary *p = [NSMutableDictionary dictionaryWithObjectsAndKeys: - (NSString*)qString2CFStringRef(requestCookie.name()), NSHTTPCookieName, - (NSString*)qString2CFStringRef(requestCookie.value()), NSHTTPCookieValue, - (NSString*)qString2CFStringRef(requestCookie.domain()), NSHTTPCookieDomain, - (NSString*)qString2CFStringRef(requestCookie.path()), NSHTTPCookiePath, + qString2CFStringRef(requestCookie.name()), NSHTTPCookieName, + qString2CFStringRef(requestCookie.value()), NSHTTPCookieValue, + qString2CFStringRef(requestCookie.domain()), NSHTTPCookieDomain, + qString2CFStringRef(requestCookie.path()), NSHTTPCookiePath, nil ]; if (requestCookie.isSessionCookie()) @@ -407,7 +406,7 @@ void QT7PlayerSession::setMedia(const QMediaContent &content, QIODevice *stream) } NSError *err = 0; - NSString *urlString = (NSString *)qString2CFStringRef(request.url().toString()); + NSString *urlString = qString2CFStringRef(request.url().toString()); NSDictionary *attr = [NSDictionary dictionaryWithObjectsAndKeys: [NSURL URLWithString:urlString], QTMovieURLAttribute, |