[vlc-devel] [vlc-commits] Don't leak a HICON

Laurent Aimar fenrir at elivagar.org
Mon Sep 5 13:51:30 CEST 2011


Hi,

On Mon, Sep 05, 2011 at 12:27:47PM +0200, Jean-Baptiste Kempf wrote:
> vlc | branch: master | Jean-Baptiste Kempf <jb at videolan.org> | Thu Sep  1 17:36:02 2011 +0200| [f118a45bd95de4ad243b87646f729b010b71ffaf] | committer: Jean-Baptiste Kempf
> 
> Don't leak a HICON
> 
> @@ -707,6 +708,9 @@ static void DirectXCloseWindow( event_thread_t *p_event )
>          vout_display_DeleteWindow( vd, p_event->parent_window );
>      p_event->hwnd = NULL;
>  
> +    if( p_event->vlc_icon )
> +        DestroyIcon( p_event->vlc_icon );
> +
>      HINSTANCE hInstance = GetModuleHandle(NULL);
>      UnregisterClass( p_event->class_video, hInstance );
>      UnregisterClass( p_event->class_main, hInstance );

 I am not 100% sure, but I think it would be better/safer to release the
icon after the associated classes are released.

-- 
fenrir



More information about the vlc-devel mailing list