diff --git a/common/widgets/color_swatch.cpp b/common/widgets/color_swatch.cpp index 354ed5df3a..fb39962d81 100644 --- a/common/widgets/color_swatch.cpp +++ b/common/widgets/color_swatch.cpp @@ -152,11 +152,11 @@ void COLOR_SWATCH::GetNewSwatchColor() { wxColourData colourData; colourData.SetColour( m_color.ToColour() ); - wxColourDialog* dialog = new wxColourDialog( this, &colourData ); + wxColourDialog dialog( this, &colourData ); - if( dialog->ShowModal() == wxID_OK ) + if( dialog.ShowModal() == wxID_OK ) { - newColor = COLOR4D( dialog->GetColourData().GetColour() ); + newColor = COLOR4D( dialog.GetColourData().GetColour() ); } } else