[vlc-devel] commit: Remove useless test. At that point, p_sys is not NULL ( Jean-Baptiste Kempf )
git version control
git at videolan.org
Wed Oct 1 10:15:06 CEST 2008
vlc | branch: master | Jean-Baptiste Kempf <jb at videolan.org> | Wed Oct 1 01:13:25 2008 -0700| [aafc08e43ce3b73eb02f05499f9bc36a99f54cdc] | committer: Jean-Baptiste Kempf
Remove useless test. At that point, p_sys is not NULL
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=aafc08e43ce3b73eb02f05499f9bc36a99f54cdc
---
modules/video_output/msw/direct3d.c | 8 +++-----
modules/video_output/msw/glwin32.c | 7 ++-----
modules/video_output/msw/wingdi.c | 7 ++-----
3 files changed, 7 insertions(+), 15 deletions(-)
diff --git a/modules/video_output/msw/direct3d.c b/modules/video_output/msw/direct3d.c
index 5591cbb..ea02a4d 100644
--- a/modules/video_output/msw/direct3d.c
+++ b/modules/video_output/msw/direct3d.c
@@ -154,6 +154,7 @@ static int OpenVideo( vlc_object_t *p_this )
p_vout->p_sys = malloc( sizeof( vout_sys_t ) );
if( p_vout->p_sys == NULL )
return VLC_ENOMEM;
+
memset( p_vout->p_sys, 0, sizeof( vout_sys_t ) );
if( VLC_SUCCESS != Direct3DVoutCreate( p_vout ) )
@@ -307,11 +308,8 @@ static void CloseVideo( vlc_object_t *p_this )
p_vout->p_sys->i_spi_screensavetimeout, NULL, 0);
}
- if( p_vout->p_sys )
- {
- free( p_vout->p_sys );
- p_vout->p_sys = NULL;
- }
+ free( p_vout->p_sys );
+ p_vout->p_sys = NULL;
}
/*****************************************************************************
diff --git a/modules/video_output/msw/glwin32.c b/modules/video_output/msw/glwin32.c
index f2c97de..bf49e2b 100644
--- a/modules/video_output/msw/glwin32.c
+++ b/modules/video_output/msw/glwin32.c
@@ -246,11 +246,8 @@ static void CloseVideo( vlc_object_t *p_this )
vlc_mutex_destroy( &p_vout->p_sys->lock );
- if( p_vout->p_sys )
- {
- free( p_vout->p_sys );
- p_vout->p_sys = NULL;
- }
+ free( p_vout->p_sys );
+ p_vout->p_sys = NULL;
}
/*****************************************************************************
diff --git a/modules/video_output/msw/wingdi.c b/modules/video_output/msw/wingdi.c
index 73f560b..874ed30 100644
--- a/modules/video_output/msw/wingdi.c
+++ b/modules/video_output/msw/wingdi.c
@@ -358,11 +358,8 @@ static void CloseVideo ( vlc_object_t *p_this )
FreeLibrary( p_vout->p_sys->gapi_dll );
#endif
- if( p_vout->p_sys )
- {
- free( p_vout->p_sys );
- p_vout->p_sys = NULL;
- }
+ free( p_vout->p_sys );
+ p_vout->p_sys = NULL;
}
/*****************************************************************************
More information about the vlc-devel
mailing list