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