diff --git a/src/gui/symbology/qgsgraduatedsymbolrendererwidget.cpp b/src/gui/symbology/qgsgraduatedsymbolrendererwidget.cpp index 67cc387363db..e26b3e3f0930 100644 --- a/src/gui/symbology/qgsgraduatedsymbolrendererwidget.cpp +++ b/src/gui/symbology/qgsgraduatedsymbolrendererwidget.cpp @@ -925,9 +925,10 @@ void QgsGraduatedSymbolRendererWidget::clearParameterWidgets() for ( QLayoutItem *item : {row.labelItem, row.fieldItem} ) if ( item ) { - if ( item->widget() ) - item->widget()->deleteLater(); + QWidget *widget = item->widget(); delete item; + if ( widget ) + delete widget; } } mParameterWidgetWrappers.clear();