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