[vlc-commits] qt: don't call SHAddToRecentDocs() with NULL

Steve Lhomme git at videolan.org
Wed Apr 3 09:55:59 CEST 2019


vlc | branch: master | Steve Lhomme <robux4 at ycbcr.xyz> | Wed Apr  3 09:07:30 2019 +0200| [5de99d33a801b689bdae9da90c02c5c7f9c8a5a0] | committer: Steve Lhomme

qt: don't call SHAddToRecentDocs() with NULL

According to the doc it resets the list of recent documents.

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=5de99d33a801b689bdae9da90c02c5c7f9c8a5a0
---

 modules/gui/qt/recents.cpp | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/modules/gui/qt/recents.cpp b/modules/gui/qt/recents.cpp
index 44b700479b..282be6327e 100644
--- a/modules/gui/qt/recents.cpp
+++ b/modules/gui/qt/recents.cpp
@@ -91,8 +91,11 @@ void RecentsMRL::addRecent( const QString &mrl )
     if( path )
     {
         wchar_t *wmrl = ToWide( path );
-        SHAddToRecentDocs( SHARD_PATHW, wmrl );
-        free( wmrl );
+        if (wmrl != NULL)
+        {
+            SHAddToRecentDocs( SHARD_PATHW, wmrl );
+            free( wmrl );
+        }
         free( path );
     }
 #endif



More information about the vlc-commits mailing list