Commit 303113c7 authored by Rémi Duraffort's avatar Rémi Duraffort

some cleaning.

parent f0b4c96f
...@@ -435,8 +435,7 @@ static void Close( vlc_object_t *p_this ) ...@@ -435,8 +435,7 @@ static void Close( vlc_object_t *p_this )
vlc_mutex_unlock( &rm_mutex ); vlc_mutex_unlock( &rm_mutex );
if ( p_sys ) free( p_sys );
free( p_sys );
} }
/***************************************************************************** /*****************************************************************************
......
...@@ -502,14 +502,13 @@ static void Run( intf_thread_t *p_intf ) ...@@ -502,14 +502,13 @@ static void Run( intf_thread_t *p_intf )
if (fd == -1) if (fd == -1)
continue; continue;
telnet_client_t *cl = malloc( sizeof( telnet_client_t )); telnet_client_t *cl = calloc( 1, sizeof( telnet_client_t ));
if (cl == NULL) if (cl == NULL)
{ {
net_Close (fd); net_Close (fd);
continue; continue;
} }
memset( cl, 0, sizeof(telnet_client_t) );
cl->i_tel_cmd = 0; cl->i_tel_cmd = 0;
cl->fd = fd; cl->fd = fd;
cl->buffer_write = NULL; cl->buffer_write = NULL;
......
...@@ -380,8 +380,7 @@ static int Open( vlc_object_t * p_this ) ...@@ -380,8 +380,7 @@ static int Open( vlc_object_t * p_this )
return VLC_SUCCESS; return VLC_SUCCESS;
error: error:
if( p_sys ) free( p_sys );
free( p_sys );
return VLC_EGENERIC; return VLC_EGENERIC;
} }
......
...@@ -48,10 +48,7 @@ void CmdChangeSkin::execute() ...@@ -48,10 +48,7 @@ void CmdChangeSkin::execute()
// Everything went well // Everything went well
msg_Info( getIntf(), "new theme successfully loaded (%s)", msg_Info( getIntf(), "new theme successfully loaded (%s)",
m_file.c_str() ); m_file.c_str() );
if( pOldTheme ) delete pOldTheme;
{
delete pOldTheme;
}
} }
else if( pOldTheme ) else if( pOldTheme )
{ {
......
...@@ -45,10 +45,7 @@ CtrlGeneric::CtrlGeneric( intf_thread_t *pIntf, const UString &rHelp, ...@@ -45,10 +45,7 @@ CtrlGeneric::CtrlGeneric( intf_thread_t *pIntf, const UString &rHelp,
CtrlGeneric::~CtrlGeneric() CtrlGeneric::~CtrlGeneric()
{ {
if( m_pPosition ) delete m_pPosition;
{
delete m_pPosition;
}
if( m_pVisible ) if( m_pVisible )
{ {
m_pVisible->delObserver( this ); m_pVisible->delObserver( this );
...@@ -60,10 +57,7 @@ void CtrlGeneric::setLayout( GenericLayout *pLayout, ...@@ -60,10 +57,7 @@ void CtrlGeneric::setLayout( GenericLayout *pLayout,
const Position &rPosition ) const Position &rPosition )
{ {
m_pLayout = pLayout; m_pLayout = pLayout;
if( m_pPosition ) delete m_pPosition;
{
delete m_pPosition;
}
m_pPosition = new Position( rPosition ); m_pPosition = new Position( rPosition );
onPositionChange(); onPositionChange();
} }
......
...@@ -104,18 +104,9 @@ CtrlText::CtrlText( intf_thread_t *pIntf, VarText &rVariable, ...@@ -104,18 +104,9 @@ CtrlText::CtrlText( intf_thread_t *pIntf, VarText &rVariable,
CtrlText::~CtrlText() CtrlText::~CtrlText()
{ {
m_rVariable.delObserver( this ); m_rVariable.delObserver( this );
if( m_pTimer ) delete m_pTimer;
{ delete m_pImg;
delete m_pTimer; delete m_pImgDouble;
}
if( m_pImg )
{
delete m_pImg;
}
if( m_pImgDouble )
{
delete m_pImgDouble;
}
} }
...@@ -224,10 +215,7 @@ void CtrlText::displayText( const UString &rText ) ...@@ -224,10 +215,7 @@ void CtrlText::displayText( const UString &rText )
{ {
// Create the images ('normal' and 'double') from the text // Create the images ('normal' and 'double') from the text
// 'Normal' image // 'Normal' image
if( m_pImg ) delete m_pImg;
{
delete m_pImg;
}
m_pImg = m_rFont.drawString( rText, m_color ); m_pImg = m_rFont.drawString( rText, m_color );
if( !m_pImg ) if( !m_pImg )
{ {
...@@ -235,10 +223,7 @@ void CtrlText::displayText( const UString &rText ) ...@@ -235,10 +223,7 @@ void CtrlText::displayText( const UString &rText )
} }
// 'Double' image // 'Double' image
const UString doubleStringWithSep = rText + SEPARATOR_STRING + rText; const UString doubleStringWithSep = rText + SEPARATOR_STRING + rText;
if( m_pImgDouble ) delete m_pImgDouble;
{
delete m_pImgDouble;
}
m_pImgDouble = m_rFont.drawString( doubleStringWithSep, m_color ); m_pImgDouble = m_rFont.drawString( doubleStringWithSep, m_color );
// Update the current image used, as if the control size had changed // Update the current image used, as if the control size had changed
......
...@@ -81,10 +81,7 @@ CtrlTree::~CtrlTree() ...@@ -81,10 +81,7 @@ CtrlTree::~CtrlTree()
{ {
m_rTree.getPositionVar().delObserver( this ); m_rTree.getPositionVar().delObserver( this );
m_rTree.delObserver( this ); m_rTree.delObserver( this );
if( m_pImage ) delete m_pImage;
{
delete m_pImage;
}
} }
int CtrlTree::itemHeight() int CtrlTree::itemHeight()
...@@ -729,10 +726,7 @@ void CtrlTree::makeImage() ...@@ -729,10 +726,7 @@ void CtrlTree::makeImage()
{ {
stats_TimerStart( getIntf(), "[Skins] Playlist image", stats_TimerStart( getIntf(), "[Skins] Playlist image",
STATS_TIMER_SKINS_PLAYTREE_IMAGE ); STATS_TIMER_SKINS_PLAYTREE_IMAGE );
if( m_pImage ) delete m_pImage;
{
delete m_pImage;
}
// Get the size of the control // Get the size of the control
const Position *pPos = getPosition(); const Position *pPos = getPosition();
......
...@@ -51,10 +51,7 @@ CtrlVideo::~CtrlVideo() ...@@ -51,10 +51,7 @@ CtrlVideo::~CtrlVideo()
VarBox &rVoutSize = VlcProc::instance( getIntf() )->getVoutSizeVar(); VarBox &rVoutSize = VlcProc::instance( getIntf() )->getVoutSizeVar();
rVoutSize.delObserver( this ); rVoutSize.delObserver( this );
if( m_pVout ) delete m_pVout;
{
delete m_pVout;
}
} }
......
...@@ -54,10 +54,7 @@ GenericLayout::GenericLayout( intf_thread_t *pIntf, int width, int height, ...@@ -54,10 +54,7 @@ GenericLayout::GenericLayout( intf_thread_t *pIntf, int width, int height,
GenericLayout::~GenericLayout() GenericLayout::~GenericLayout()
{ {
if( m_pImage ) delete m_pImage;
{
delete m_pImage;
}
list<Anchor*>::const_iterator it; list<Anchor*>::const_iterator it;
for( it = m_anchorList.begin(); it != m_anchorList.end(); it++ ) for( it = m_anchorList.begin(); it != m_anchorList.end(); it++ )
{ {
......
...@@ -62,10 +62,7 @@ GenericWindow::~GenericWindow() ...@@ -62,10 +62,7 @@ GenericWindow::~GenericWindow()
{ {
m_pVarVisible->delObserver( this ); m_pVarVisible->delObserver( this );
if( m_pOsWindow ) delete m_pOsWindow;
{
delete m_pOsWindow;
}
} }
......
...@@ -51,10 +51,7 @@ Tooltip::~Tooltip() ...@@ -51,10 +51,7 @@ Tooltip::~Tooltip()
VarManager::instance( getIntf() )->getTooltipText().delObserver( this ); VarManager::instance( getIntf() )->getTooltipText().delObserver( this );
SKINS_DELETE( m_pTimer ); SKINS_DELETE( m_pTimer );
SKINS_DELETE( m_pOsTooltip ); SKINS_DELETE( m_pOsTooltip );
if( m_pImage ) delete m_pImage;
{
delete m_pImage;
}
} }
...@@ -106,10 +103,7 @@ void Tooltip::makeImage( const UString &rText ) ...@@ -106,10 +103,7 @@ void Tooltip::makeImage( const UString &rText )
int h = m_rFont.getSize() + 8; int h = m_rFont.getSize() + 8;
// Create the image of the tooltip // Create the image of the tooltip
if( m_pImage ) delete m_pImage;
{
delete m_pImage;
}
m_pImage = OSFactory::instance( getIntf() )->createOSGraphics( w, h ); m_pImage = OSFactory::instance( getIntf() )->createOSGraphics( w, h );
m_pImage->fillRect( 0, 0, w, h, 0xffffd0 ); m_pImage->fillRect( 0, 0, w, h, 0xffffd0 );
m_pImage->drawRect( 0, 0, w, h, 0x000000 ); m_pImage->drawRect( 0, 0, w, h, 0x000000 );
......
...@@ -39,10 +39,7 @@ VoutWindow::VoutWindow( intf_thread_t *pIntf, int left, int top, ...@@ -39,10 +39,7 @@ VoutWindow::VoutWindow( intf_thread_t *pIntf, int left, int top,
VoutWindow::~VoutWindow() VoutWindow::~VoutWindow()
{ {
if( m_pImage ) delete m_pImage;
{
delete m_pImage;
}
// Get the VlcProc // Get the VlcProc
VlcProc *pVlcProc = getIntf()->p_sys->p_vlcProc; VlcProc *pVlcProc = getIntf()->p_sys->p_vlcProc;
...@@ -61,10 +58,7 @@ void VoutWindow::resize( int width, int height ) ...@@ -61,10 +58,7 @@ void VoutWindow::resize( int width, int height )
OSFactory *pOsFactory = OSFactory::instance( getIntf() ); OSFactory *pOsFactory = OSFactory::instance( getIntf() );
// Recreate the image // Recreate the image
if( m_pImage ) delete m_pImage;
{
delete m_pImage;
}
m_pImage = pOsFactory->createOSGraphics( width, height ); m_pImage = pOsFactory->createOSGraphics( width, height );
// Draw a black rectangle // Draw a black rectangle
m_pImage->fillRect( 0, 0, width, height, 0 ); m_pImage->fillRect( 0, 0, width, height, 0 );
......
...@@ -280,7 +280,7 @@ static int vlclua_playlist_get( lua_State *L ) ...@@ -280,7 +280,7 @@ static int vlclua_playlist_get( lua_State *L )
} }
} }
#else #else
# warning Don't access playlist iternal, broken code here. # warning "Don't access playlist iternal, broken code here."
abort(); abort();
#endif #endif
if( !p_item ) if( !p_item )
......
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