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()
void KateExternalToolsConfigWidget::slotAddTool()
{
auto tool = new KateExternalTool();
if (editTool(tool)) {
addNewTool(tool);
} else {
delete tool;
std::unique_ptr tool = std::make_unique<KateExternalTool>();
if (editTool(tool.get())) {
addNewTool(tool.release());
}
}
......
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