]> git.sur5r.net Git - minitube/commitdiff
Fixed memory leaks
authorFlavio Tordini <flavio.tordini@gmail.com>
Sun, 20 Sep 2015 08:18:45 +0000 (10:18 +0200)
committerFlavio Tordini <flavio.tordini@gmail.com>
Sun, 20 Sep 2015 08:19:18 +0000 (10:19 +0200)
src/aggregatevideosource.cpp
src/ytsinglevideosource.cpp
src/ytstandardfeed.cpp

index 2c5f33072188682d5b8fdc67c31473a52c10803f..dfffebfc33831424d4331c505e2a420190dd3a74 100644 (file)
@@ -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() { }
index 608b222e48f184bdde612a3229d59599fe4619ff..cf734b73349a7b04fc96aedf1141f3fe42d42193 100644 (file)
@@ -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() {
index 1a835a4c44744393e50ea583e6bef698883233d8..e6f640842434379975ac92855a7677602053c251 100644 (file)
@@ -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) {