[vlc-commits] qt: fix error mode race (Win32)

Rémi Denis-Courmont git at videolan.org
Sun Dec 3 17:13:15 CET 2017


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Sun Dec  3 18:08:38 2017 +0200| [4f9e07b418eecd645aa766023fec9e0cd85c7c52] | committer: Rémi Denis-Courmont

qt: fix error mode race (Win32)

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

 modules/gui/qt/components/open_panels.cpp | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/modules/gui/qt/components/open_panels.cpp b/modules/gui/qt/components/open_panels.cpp
index 9b154322e5..cffc40348a 100644
--- a/modules/gui/qt/components/open_panels.cpp
+++ b/modules/gui/qt/components/open_panels.cpp
@@ -384,7 +384,7 @@ void DiscOpenPanel::onFocus()
     if( GetLogicalDriveStringsW( sizeof( szDrives ) / sizeof( *szDrives ) - 1, szDrives ) )
     {
         wchar_t *drive = szDrives;
-        UINT oldMode = SetErrorMode( SEM_FAILCRITICALERRORS );
+        SetThreadErrorMode( SEM_FAILCRITICALERRORS, &oldMode );
         while( *drive )
         {
             if( GetDriveTypeW(drive) == DRIVE_CDROM )
@@ -407,7 +407,7 @@ void DiscOpenPanel::onFocus()
             /* go to next drive */
             while( *(drive++) );
         }
-        SetErrorMode(oldMode);
+        SetThreadErrorMode(oldMode, NULL);
     }
 
     char *psz_config = config_GetPsz( p_intf, "dvd" );



More information about the vlc-commits mailing list