Skip to content
Snippets Groups Projects
Commit 66a26b9d authored by Wuttke, Joachim's avatar Wuttke, Joachim
Browse files

PlotStatusLabel: disconnect removed plot (#995)

parent 12969ad4
No related branches found
No related tags found
1 merge request!2645PlotStatusLabel: use std::vector; disconnect removed plot (#995)
Pipeline #150121 failed
......@@ -13,6 +13,7 @@
// ************************************************************************************************
#include "GUI/View/Plotter/PlotStatusLabel.h"
#include "Base/Util/Assert.h"
#include "GUI/View/Base/Fontsize.h"
#include "GUI/View/Plotter/MousyPlot.h"
#include <QColor>
......@@ -85,7 +86,10 @@ void PlotStatusLabel::setPlotLabelEnabled(MousyPlot* plot)
void PlotStatusLabel::onPlotDestroyed(QObject* obj)
{
auto it =
std::remove_if(m_plots.begin(), m_plots.end(), [obj](MousyPlot* cm) { return cm == obj; });
m_plots.erase(it, m_plots.end());
auto* old_plot = dynamic_cast<MousyPlot*>(obj);
ASSERT(old_plot);
for (auto it = m_plots.begin(); it != m_plots.end(); ++it)
if (*it == old_plot)
m_plots.erase(it);
disconnect(old_plot);
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment