Commit 95f14593 authored by ivoire's avatar ivoire Committed by Jean-Baptiste Kempf
Browse files

qt4: fix memory leaks

parent aa62e230
...@@ -539,7 +539,10 @@ bool PrefsItemData::contains( const QString &text, Qt::CaseSensitivity cs ) ...@@ -539,7 +539,10 @@ bool PrefsItemData::contains( const QString &text, Qt::CaseSensitivity cs )
} }
if (name.contains( text, cs ) || head.contains( text, cs ) || help.contains( text, cs )) if (name.contains( text, cs ) || head.contains( text, cs ) || help.contains( text, cs ))
{
module_config_free( p_config );
return true; return true;
}
if( p_item ) do if( p_item ) do
{ {
...@@ -555,7 +558,10 @@ bool PrefsItemData::contains( const QString &text, Qt::CaseSensitivity cs ) ...@@ -555,7 +558,10 @@ bool PrefsItemData::contains( const QString &text, Qt::CaseSensitivity cs )
if( p_item->b_internal ) continue; if( p_item->b_internal ) continue;
if ( p_item->psz_text && qtr( p_item->psz_text ).contains( text, cs ) ) if ( p_item->psz_text && qtr( p_item->psz_text ).contains( text, cs ) )
{
module_config_free( p_config );
return true; return true;
}
} }
while ( while (
!( !(
...@@ -566,6 +572,7 @@ bool PrefsItemData::contains( const QString &text, Qt::CaseSensitivity cs ) ...@@ -566,6 +572,7 @@ bool PrefsItemData::contains( const QString &text, Qt::CaseSensitivity cs )
&& ( ++p_item < p_end ) && ( ++p_item < p_end )
); );
module_config_free( p_config );
return false; return false;
} }
...@@ -592,7 +599,7 @@ AdvPrefsPanel::AdvPrefsPanel( intf_thread_t *_p_intf, QWidget *_parent, ...@@ -592,7 +599,7 @@ AdvPrefsPanel::AdvPrefsPanel( intf_thread_t *_p_intf, QWidget *_parent,
} }
unsigned confsize; unsigned confsize;
module_config_t *const p_config = module_config_get (p_module, &confsize), module_config_t *const p_config = module_config_get( p_module, &confsize ),
*p_item = p_config, *p_item = p_config,
*p_end = p_config + confsize; *p_end = p_config + confsize;
...@@ -723,6 +730,8 @@ AdvPrefsPanel::AdvPrefsPanel( intf_thread_t *_p_intf, QWidget *_parent, ...@@ -723,6 +730,8 @@ AdvPrefsPanel::AdvPrefsPanel( intf_thread_t *_p_intf, QWidget *_parent,
scroller->setWidgetResizable( true ); scroller->setWidgetResizable( true );
global_layout->addWidget( scroller ); global_layout->addWidget( scroller );
setLayout( global_layout ); setLayout( global_layout );
module_config_free( p_config );
} }
void AdvPrefsPanel::apply() void AdvPrefsPanel::apply()
......
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