Commit 66c53a28 authored by Hannes Domani's avatar Hannes Domani Committed by Jean-Baptiste Kempf

Qt: fix memory leaks

QTreeWidgetItem::setData() doesn't take ownership
Signed-off-by: Jean-Baptiste Kempf's avatarJean-Baptiste Kempf <jb@videolan.org>
parent 3d934764
......@@ -101,7 +101,7 @@ PrefsTree::PrefsTree( intf_thread_t *_p_intf, QWidget *_parent ) :
if( p_item->value.i == -1 ) break;
/* PrefsItemData Init */
data = new PrefsItemData();
data = new PrefsItemData( this );
data->name = qtr( config_CategoryNameGet( p_item->value.i ) );
psz_help = config_CategoryHelpGet( p_item->value.i );
if( psz_help )
......@@ -167,7 +167,7 @@ PrefsTree::PrefsTree( intf_thread_t *_p_intf, QWidget *_parent ) :
/* Normal Subcategories */
/* Process the Data */
data_sub = new PrefsItemData();
data_sub = new PrefsItemData( this );
data_sub->name = qtr( config_CategoryNameGet( p_item->value.i) );
psz_help = config_CategoryHelpGet( p_item->value.i );
if( psz_help )
......@@ -268,7 +268,7 @@ PrefsTree::PrefsTree( intf_thread_t *_p_intf, QWidget *_parent ) :
}
if( !b_found ) continue;
PrefsItemData *module_data = new PrefsItemData();
PrefsItemData *module_data = new PrefsItemData( this );
module_data->i_type = PrefsItemData::TYPE_MODULE;
module_data->psz_shortcut = strdup( module_get_object( p_module ) );
module_data->name = qtr( module_get_name( p_module, false ) );
......@@ -478,7 +478,7 @@ void PrefsTree::resizeColumns()
resizeColumnToContents( 0 );
}
PrefsItemData::PrefsItemData()
PrefsItemData::PrefsItemData( QObject *_parent ) : QObject( _parent )
{
panel = NULL;
i_object_id = 0;
......
......@@ -41,7 +41,7 @@ class PrefsItemData : public QObject
{
Q_OBJECT
public:
PrefsItemData();
PrefsItemData( QObject * );
virtual ~PrefsItemData() { free( psz_shortcut ); };
bool contains( const QString &text, Qt::CaseSensitivity cs );
AdvPrefsPanel *panel;
......
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