Commit 707ee8ea authored by Clément Stenac's avatar Clément Stenac

Fix segfault when child vout creation fails

parent fd59fcbf
...@@ -204,9 +204,12 @@ static void Destroy( vlc_object_t *p_this ) ...@@ -204,9 +204,12 @@ static void Destroy( vlc_object_t *p_this )
{ {
vout_thread_t *p_vout = (vout_thread_t *)p_this; vout_thread_t *p_vout = (vout_thread_t *)p_this;
if( p_vout->p_sys->p_vout )
{
DEL_CALLBACKS( p_vout->p_sys->p_vout, SendEvents ); DEL_CALLBACKS( p_vout->p_sys->p_vout, SendEvents );
vlc_object_detach( p_vout->p_sys->p_vout ); vlc_object_detach( p_vout->p_sys->p_vout );
vout_Destroy( p_vout->p_sys->p_vout ); vout_Destroy( p_vout->p_sys->p_vout );
}
DEL_PARENT_CALLBACKS( SendEventsToChild ); DEL_PARENT_CALLBACKS( SendEventsToChild );
......
...@@ -287,9 +287,12 @@ static void Destroy( vlc_object_t *p_this ) ...@@ -287,9 +287,12 @@ static void Destroy( vlc_object_t *p_this )
{ {
vout_thread_t *p_vout = (vout_thread_t *)p_this; vout_thread_t *p_vout = (vout_thread_t *)p_this;
if( p_vout->p_sys->p_vout )
{
DEL_CALLBACKS( p_vout->p_sys->p_vout, SendEvents ); DEL_CALLBACKS( p_vout->p_sys->p_vout, SendEvents );
vlc_object_detach( p_vout->p_sys->p_vout ); vlc_object_detach( p_vout->p_sys->p_vout );
vout_Destroy( p_vout->p_sys->p_vout ); vout_Destroy( p_vout->p_sys->p_vout );
}
DEL_PARENT_CALLBACKS( SendEventsToChild ); DEL_PARENT_CALLBACKS( SendEventsToChild );
......
...@@ -182,7 +182,6 @@ static int Init( vout_thread_t *p_vout ) ...@@ -182,7 +182,6 @@ static int Init( vout_thread_t *p_vout )
if( p_vout->p_sys->p_vout == NULL ) if( p_vout->p_sys->p_vout == NULL )
{ {
msg_Err( p_vout, "cannot open vout, aborting" ); msg_Err( p_vout, "cannot open vout, aborting" );
return VLC_EGENERIC; return VLC_EGENERIC;
} }
...@@ -222,9 +221,12 @@ static void Destroy( vlc_object_t *p_this ) ...@@ -222,9 +221,12 @@ static void Destroy( vlc_object_t *p_this )
{ {
vout_thread_t *p_vout = (vout_thread_t *)p_this; vout_thread_t *p_vout = (vout_thread_t *)p_this;
if( p_vout->p_sys->p_vout )
{
DEL_CALLBACKS( p_vout->p_sys->p_vout, SendEvents ); DEL_CALLBACKS( p_vout->p_sys->p_vout, SendEvents );
vlc_object_detach( p_vout->p_sys->p_vout ); vlc_object_detach( p_vout->p_sys->p_vout );
vout_Destroy( p_vout->p_sys->p_vout ); vout_Destroy( p_vout->p_sys->p_vout );
}
DEL_PARENT_CALLBACKS( SendEventsToChild ); DEL_PARENT_CALLBACKS( SendEventsToChild );
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* filter_common.h: Common filter functions * filter_common.h: Common filter functions
***************************************************************************** *****************************************************************************
* Copyright (C) 2001, 2002, 2003 VideoLAN * Copyright (C) 2001, 2002, 2003 VideoLAN
* $Id: filter_common.h,v 1.6 2004/02/22 15:57:41 fenrir Exp $ * $Id$
* *
* Authors: Samuel Hocevar <sam@zoy.org> * Authors: Samuel Hocevar <sam@zoy.org>
* *
......
...@@ -165,9 +165,12 @@ static void Destroy( vlc_object_t *p_this ) ...@@ -165,9 +165,12 @@ static void Destroy( vlc_object_t *p_this )
{ {
vout_thread_t *p_vout = (vout_thread_t *)p_this; vout_thread_t *p_vout = (vout_thread_t *)p_this;
if( p_vout->p_sys->p_vout )
{
DEL_CALLBACKS( p_vout->p_sys->p_vout, SendEvents ); DEL_CALLBACKS( p_vout->p_sys->p_vout, SendEvents );
vlc_object_detach( p_vout->p_sys->p_vout ); vlc_object_detach( p_vout->p_sys->p_vout );
vout_Destroy( p_vout->p_sys->p_vout ); vout_Destroy( p_vout->p_sys->p_vout );
}
DEL_PARENT_CALLBACKS( SendEventsToChild ); DEL_PARENT_CALLBACKS( SendEventsToChild );
......
...@@ -314,9 +314,12 @@ static void End( vout_thread_t *p_vout ) ...@@ -314,9 +314,12 @@ static void End( vout_thread_t *p_vout )
var_DelCallback( p_vout->p_sys->p_vout, "mouse-x", MouseEvent, p_vout); var_DelCallback( p_vout->p_sys->p_vout, "mouse-x", MouseEvent, p_vout);
var_DelCallback( p_vout->p_sys->p_vout, "mouse-y", MouseEvent, p_vout); var_DelCallback( p_vout->p_sys->p_vout, "mouse-y", MouseEvent, p_vout);
if( p_vout->p_sys->p_vout )
{
DEL_CALLBACKS( p_vout->p_sys->p_vout, SendEvents ); DEL_CALLBACKS( p_vout->p_sys->p_vout, SendEvents );
vlc_object_detach( p_vout->p_sys->p_vout ); vlc_object_detach( p_vout->p_sys->p_vout );
vout_Destroy( p_vout->p_sys->p_vout ); vout_Destroy( p_vout->p_sys->p_vout );
}
config_PutInt( p_vout, "logo-x", p_vout->p_sys->posx ); config_PutInt( p_vout, "logo-x", p_vout->p_sys->posx );
config_PutInt( p_vout, "logo-y", p_vout->p_sys->posy ); config_PutInt( p_vout, "logo-y", p_vout->p_sys->posy );
......
...@@ -207,9 +207,12 @@ static void Destroy( vlc_object_t *p_this ) ...@@ -207,9 +207,12 @@ static void Destroy( vlc_object_t *p_this )
{ {
vout_thread_t *p_vout = (vout_thread_t *)p_this; vout_thread_t *p_vout = (vout_thread_t *)p_this;
if( p_vout->p_sys->p_vout )
{
DEL_CALLBACKS( p_vout->p_sys->p_vout, SendEvents ); DEL_CALLBACKS( p_vout->p_sys->p_vout, SendEvents );
vlc_object_detach( p_vout->p_sys->p_vout ); vlc_object_detach( p_vout->p_sys->p_vout );
vout_Destroy( p_vout->p_sys->p_vout ); vout_Destroy( p_vout->p_sys->p_vout );
}
DEL_PARENT_CALLBACKS( SendEventsToChild ); DEL_PARENT_CALLBACKS( SendEventsToChild );
......
...@@ -245,9 +245,12 @@ static void Destroy( vlc_object_t *p_this ) ...@@ -245,9 +245,12 @@ static void Destroy( vlc_object_t *p_this )
{ {
vout_thread_t *p_vout = (vout_thread_t *)p_this; vout_thread_t *p_vout = (vout_thread_t *)p_this;
if( p_vout->p_sys->p_vout )
{
DEL_CALLBACKS( p_vout->p_sys->p_vout, SendEvents ); DEL_CALLBACKS( p_vout->p_sys->p_vout, SendEvents );
vlc_object_detach( p_vout->p_sys->p_vout ); vlc_object_detach( p_vout->p_sys->p_vout );
vout_Destroy( p_vout->p_sys->p_vout ); vout_Destroy( p_vout->p_sys->p_vout );
}
DEL_PARENT_CALLBACKS( SendEventsToChild ); DEL_PARENT_CALLBACKS( SendEventsToChild );
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment