From 1e0797e333e3860c362b100dee26568d880f638b Mon Sep 17 00:00:00 2001 From: Flavio Tordini Date: Sun, 20 Sep 2015 10:18:45 +0200 Subject: [PATCH] Fixed memory leaks --- src/aggregatevideosource.cpp | 4 ++-- src/ytsinglevideosource.cpp | 4 ++-- src/ytstandardfeed.cpp | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/aggregatevideosource.cpp b/src/aggregatevideosource.cpp index 2c5f330..dfffebf 100644 --- a/src/aggregatevideosource.cpp +++ b/src/aggregatevideosource.cpp @@ -79,8 +79,8 @@ bool AggregateVideoSource::hasMoreVideos() { } const QStringList & AggregateVideoSource::getSuggestions() { - QStringList *l = new QStringList(); - return *l; + static const QStringList l; + return l; } void AggregateVideoSource::abort() { } diff --git a/src/ytsinglevideosource.cpp b/src/ytsinglevideosource.cpp index 608b222..cf734b7 100644 --- a/src/ytsinglevideosource.cpp +++ b/src/ytsinglevideosource.cpp @@ -158,8 +158,8 @@ void YTSingleVideoSource::abort() { } const QStringList & YTSingleVideoSource::getSuggestions() { - static const QStringList *l = new QStringList(); - return *l; + static const QStringList l; + return l; } QString YTSingleVideoSource::getName() { diff --git a/src/ytstandardfeed.cpp b/src/ytstandardfeed.cpp index 1a835a4..e6f6408 100644 --- a/src/ytstandardfeed.cpp +++ b/src/ytstandardfeed.cpp @@ -135,8 +135,8 @@ void YTStandardFeed::abort() { } const QStringList & YTStandardFeed::getSuggestions() { - QStringList *l = new QStringList(); - return *l; + static const QStringList l; + return l; } void YTStandardFeed::requestError(QNetworkReply *reply) { -- 2.39.5