aboutsummaryrefslogtreecommitdiffstats
path: root/common/nextpnr.h
diff options
context:
space:
mode:
authorMiodrag Milanovic <mmicko@gmail.com>2018-06-25 14:33:49 +0200
committerMiodrag Milanovic <mmicko@gmail.com>2018-06-25 14:34:08 +0200
commitfb5fb497b5c81d3adab8e210a4942e34c5bf8e9f (patch)
tree78855c15f56a993277e03219040497c7e7e5da6c /common/nextpnr.h
parentfd8017449d920d48b1cc4ab18b473ea5a2709ca4 (diff)
downloadnextpnr-fb5fb497b5c81d3adab8e210a4942e34c5bf8e9f.tar.gz
nextpnr-fb5fb497b5c81d3adab8e210a4942e34c5bf8e9f.tar.bz2
nextpnr-fb5fb497b5c81d3adab8e210a4942e34c5bf8e9f.zip
Fix some memory leaks
Diffstat (limited to 'common/nextpnr.h')
-rw-r--r--common/nextpnr.h12
1 files changed, 12 insertions, 0 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