]> git.sesse.net Git - vlc/blobdiff - modules/video_output/msw/events.c
Use pl_Yield and pl_Release everywhere.
[vlc] / modules / video_output / msw / events.c
index 84dae385754493737a8c50102a503495aa660243..7f1aefc594bddb2954488156234153eed79ae026 100644 (file)
@@ -131,10 +131,10 @@ void EventThread( event_thread_t *p_event )
 
     /* Main loop */
     /* GetMessage will sleep if there's no message in the queue */
-    while( !p_event->b_die && GetMessage( &msg, 0, 0, 0 ) )
+    while( vlc_object_alive (p_event) && GetMessage( &msg, 0, 0, 0 ) )
     {
         /* Check if we are asked to exit */
-        if( p_event->b_die )
+        if( !vlc_object_alive (p_event) )
             break;
 
         switch( msg.message )
@@ -861,12 +861,11 @@ static long FAR PASCAL DirectXEventProc( HWND hwnd, UINT message,
     /* the user wants to close the window */
     case WM_CLOSE:
     {
-        playlist_t * p_playlist = vlc_object_find( p_vout,
-                                                  VLC_OBJECT_PLAYLIST, FIND_ANYWHERE );
+        playlist_t * p_playlist = pl_Yield( p_vout );
         if( p_playlist )
         {
             playlist_Stop( p_playlist );
-            vlc_object_release( p_playlist );
+            pl_Release( p_playlist );
         }
         return 0;
     }