From fb5fb497b5c81d3adab8e210a4942e34c5bf8e9f Mon Sep 17 00:00:00 2001 From: Miodrag Milanovic Date: Mon, 25 Jun 2018 14:33:49 +0200 Subject: Fix some memory leaks --- common/nextpnr.h | 12 ++++++++++++ gui/designwidget.cc | 1 - 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/common/nextpnr.h b/common/nextpnr.h index 5b1a6a4f..df9d7e3e 100644 --- a/common/nextpnr.h +++ b/common/nextpnr.h @@ -207,6 +207,18 @@ struct BaseCtx IdString::initialize_add(this, "", 0); IdString::initialize_arch(this); } + + ~BaseCtx() + { + for(auto &item : nets) { + delete item.second; + } + for(auto &item : cells) { + delete item.second; + } + delete idstring_str_to_idx; + delete idstring_idx_to_str; + } }; NEXTPNR_NAMESPACE_END diff --git a/gui/designwidget.cc b/gui/designwidget.cc index 8c5132e2..326c2649 100644 --- a/gui/designwidget.cc +++ b/gui/designwidget.cc @@ -227,7 +227,6 @@ void DesignWidget::prepareMenu(const QPoint &pos) QMenu menu(this); menu.addAction(selectAction); - QPoint pt(pos); menu.exec(tree->mapToGlobal(pos)); } -- cgit v1.2.3