Commit ceb40a57 authored by Ahmad Samir's avatar Ahmad Samir
Browse files

ExternalTools: use a unique_ptr to be sure we don't leak memory

parent 13de60ae
Pipeline #87428 passed with stage
in 2 minutes and 49 seconds
...@@ -483,11 +483,9 @@ void KateExternalToolsConfigWidget::slotAddCategory() ...@@ -483,11 +483,9 @@ void KateExternalToolsConfigWidget::slotAddCategory()
void KateExternalToolsConfigWidget::slotAddTool() void KateExternalToolsConfigWidget::slotAddTool()
{ {
auto tool = new KateExternalTool(); std::unique_ptr tool = std::make_unique<KateExternalTool>();
if (editTool(tool)) { if (editTool(tool.get())) {
addNewTool(tool); addNewTool(tool.release());
} else {
delete tool;
} }
} }
......
Supports Markdown
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