From 61db859c3d26b9f7e3fdb91895c57af9812b6d20 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20K=C3=A4berich?= Date: Tue, 28 May 2024 11:07:39 +0200 Subject: [PATCH] delete math operations when deleting a trace --- Software/PC_Application/LibreVNA-GUI/Traces/trace.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Software/PC_Application/LibreVNA-GUI/Traces/trace.cpp b/Software/PC_Application/LibreVNA-GUI/Traces/trace.cpp index 9267dc46..b7d2b1ba 100644 --- a/Software/PC_Application/LibreVNA-GUI/Traces/trace.cpp +++ b/Software/PC_Application/LibreVNA-GUI/Traces/trace.cpp @@ -69,6 +69,10 @@ Trace::Trace(QString name, QColor color, QString live) Trace::~Trace() { emit deleted(this); + // delete math operations. The first math operation is the trace itself, only delete any additional operations + while(mathOps.size() > 1) { + removeMathOperation(mathOps.size()-1); + } } void Trace::clear(bool force) {