diff options
author | Miodrag Milanovic <mmicko@gmail.com> | 2018-06-25 14:33:49 +0200 |
---|---|---|
committer | Miodrag Milanovic <mmicko@gmail.com> | 2018-06-25 14:34:08 +0200 |
commit | fb5fb497b5c81d3adab8e210a4942e34c5bf8e9f (patch) | |
tree | 78855c15f56a993277e03219040497c7e7e5da6c | |
parent | fd8017449d920d48b1cc4ab18b473ea5a2709ca4 (diff) | |
download | nextpnr-fb5fb497b5c81d3adab8e210a4942e34c5bf8e9f.tar.gz nextpnr-fb5fb497b5c81d3adab8e210a4942e34c5bf8e9f.tar.bz2 nextpnr-fb5fb497b5c81d3adab8e210a4942e34c5bf8e9f.zip |
Fix some memory leaks
-rw-r--r-- | common/nextpnr.h | 12 | ||||
-rw-r--r-- | gui/designwidget.cc | 1 |
2 files changed, 12 insertions, 1 deletions
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));
}
|