Commit de22c758 authored by Cyril Deguet's avatar Cyril Deguet

* all: fixed segfaults when initialization fails

parent b16f809c
......@@ -2,7 +2,7 @@
* skin_main.cpp
*****************************************************************************
* Copyright (C) 2003 VideoLAN
* $Id: skin_main.cpp,v 1.2 2004/01/11 17:12:17 asmax Exp $
* $Id: skin_main.cpp,v 1.3 2004/01/25 13:59:33 asmax Exp $
*
* Authors: Cyril Deguet <asmax@via.ecp.fr>
* Olivier Teulire <ipkiss@via.ecp.fr>
......@@ -96,6 +96,11 @@ static int Open( vlc_object_t *p_this )
p_intf->p_sys->p_theme = NULL;
// Initialize singletons
if( OSFactory::instance( p_intf ) == NULL )
{
msg_Err( p_intf, "Cannot initialize OSFactory" );
return VLC_EGENERIC;
}
if( AsyncQueue::instance( p_intf ) == NULL )
{
msg_Err( p_intf, "Cannot initialize AsyncQueue" );
......@@ -106,11 +111,6 @@ static int Open( vlc_object_t *p_this )
msg_Err( p_intf, "Cannot instanciate Interpreter" );
return VLC_EGENERIC;
}
if( OSFactory::instance( p_intf ) == NULL )
{
msg_Err( p_intf, "Cannot initialize OSFactory" );
return VLC_EGENERIC;
}
if( VarManager::instance( p_intf ) == NULL )
{
msg_Err( p_intf, "Cannot instanciate VarManager" );
......
......@@ -2,7 +2,7 @@
* x11_display.cpp
*****************************************************************************
* Copyright (C) 2003 VideoLAN
* $Id: x11_display.cpp,v 1.1 2004/01/03 23:31:34 asmax Exp $
* $Id: x11_display.cpp,v 1.2 2004/01/25 13:59:33 asmax Exp $
*
* Authors: Cyril Deguet <asmax@via.ecp.fr>
* Olivier Teulire <ipkiss@via.ecp.fr>
......@@ -51,12 +51,6 @@ X11Display::X11Display( intf_thread_t *pIntf ): SkinObject( pIntf ),
int depth = DefaultDepth( m_pDisplay, screen );
int order = ImageByteOrder( m_pDisplay );
// Create a graphics context that doesn't generate GraphicsExpose events
XGCValues xgcvalues;
xgcvalues.graphics_exposures = False;
m_gc = XCreateGC( m_pDisplay, DefaultRootWindow( m_pDisplay ),
GCGraphicsExposures, &xgcvalues );
// Template for looking up the XVisualInfo
XVisualInfo xVInfoTemplate;
xVInfoTemplate.screen = screen;
......@@ -127,6 +121,15 @@ X11Display::X11Display( intf_thread_t *pIntf ): SkinObject( pIntf ),
{
XFree( pVInfo );
}
// Create a graphics context that doesn't generate GraphicsExpose events
if( m_pDisplay )
{
XGCValues xgcvalues;
xgcvalues.graphics_exposures = False;
m_gc = XCreateGC( m_pDisplay, DefaultRootWindow( m_pDisplay ),
GCGraphicsExposures, &xgcvalues );
}
}
......
......@@ -2,7 +2,7 @@
* x11_factory.cpp
*****************************************************************************
* Copyright (C) 2003 VideoLAN
* $Id: x11_factory.cpp,v 1.1 2004/01/03 23:31:34 asmax Exp $
* $Id: x11_factory.cpp,v 1.2 2004/01/25 13:59:33 asmax Exp $
*
* Authors: Cyril Deguet <asmax@via.ecp.fr>
* Olivier Teulire <ipkiss@via.ecp.fr>
......@@ -38,7 +38,8 @@
#include "x11_tooltip.hpp"
X11Factory::X11Factory( intf_thread_t *pIntf ): OSFactory( pIntf )
X11Factory::X11Factory( intf_thread_t *pIntf ): OSFactory( pIntf ),
m_pDisplay( NULL ), m_pTimerLoop( NULL )
{
// see init()
}
......
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