diff --git a/vvp/class_type.cc b/vvp/class_type.cc index 38768aa03..3e4a41f77 100644 --- a/vvp/class_type.cc +++ b/vvp/class_type.cc @@ -387,6 +387,12 @@ class_type::class_type(const string&nam, size_t nprop) instance_size_ = 0; } +class_type::~class_type() +{ + for (size_t idx = 0 ; idx < properties_.size() ; idx += 1) + delete properties_[idx].type; +} + void class_type::set_property(size_t idx, const string&name, const string&type) { assert(idx < properties_.size()); diff --git a/vvp/class_type.h b/vvp/class_type.h index efce1925e..8304f812e 100644 --- a/vvp/class_type.h +++ b/vvp/class_type.h @@ -39,6 +39,7 @@ class class_type : public __vpiHandle { public: explicit class_type(const std::string&nam, size_t nprop); + ~class_type(); // This is the name of the class type. inline const std::string&class_name(void) const { return class_name_; } diff --git a/vvp/vpi_scope.cc b/vvp/vpi_scope.cc index f18aea030..f7dc5f313 100644 --- a/vvp/vpi_scope.cc +++ b/vvp/vpi_scope.cc @@ -132,8 +132,8 @@ void root_table_delete(void) for (unsigned idx = 0; idx < vpip_root_table_cnt; idx += 1) { struct __vpiScope *scope = static_cast<__vpiScope *> (vpip_root_table_ptr[idx]); - delete_sub_scopes(scope); vthreads_delete(scope); + delete_sub_scopes(scope); delete scope; } free(vpip_root_table_ptr);