Commit d6aa5c4b authored by Rémi Duraffort's avatar Rémi Duraffort

qt4: fix memory leak (allocate only when needed)

parent d052232e
...@@ -555,10 +555,6 @@ void DroppingController::createAndAddWidget( QBoxLayout *newControlLayout, ...@@ -555,10 +555,6 @@ void DroppingController::createAndAddWidget( QBoxLayout *newControlLayout,
buttonType_e i_type, buttonType_e i_type,
int i_option ) int i_option )
{ {
doubleInt *value = new doubleInt;
value->i_type = i_type;
value->i_option = i_option;
/* Special case for SPACERS, who aren't QWidgets */ /* Special case for SPACERS, who aren't QWidgets */
if( i_type == WIDGET_SPACER || i_type == WIDGET_SPACER_EXTEND ) if( i_type == WIDGET_SPACER || i_type == WIDGET_SPACER_EXTEND )
{ {
...@@ -628,6 +624,10 @@ void DroppingController::createAndAddWidget( QBoxLayout *newControlLayout, ...@@ -628,6 +624,10 @@ void DroppingController::createAndAddWidget( QBoxLayout *newControlLayout,
/* QList and QBoxLayout don't act the same with insert() */ /* QList and QBoxLayout don't act the same with insert() */
if( i_index < 0 ) i_index = newControlLayout->count() - 1; if( i_index < 0 ) i_index = newControlLayout->count() - 1;
doubleInt *value = new doubleInt;
value->i_type = i_type;
value->i_option = i_option;
widgetList.insert( i_index, value ); widgetList.insert( i_index, value );
} }
......
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