From: Flavio Tordini Date: Sun, 20 Sep 2015 08:18:45 +0000 (+0200) Subject: Fixed memory leaks X-Git-Tag: 2.5.1~5 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=1e0797e333e3860c362b100dee26568d880f638b;p=minitube Fixed memory leaks --- 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) {