From e61ed48914114b82eba542a76cdb458a2fef6963 Mon Sep 17 00:00:00 2001 From: Cary R Date: Fri, 9 Jan 2015 17:35:33 -0800 Subject: [PATCH] Clean up vals_words when a dynamic array is accessed using the vpi --- vvp/vpi_darray.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/vvp/vpi_darray.cc b/vvp/vpi_darray.cc index 5f00b31bd..6e4cf3402 100644 --- a/vvp/vpi_darray.cc +++ b/vvp/vpi_darray.cc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012-2014 Stephen Williams (steve@icarus.com) + * Copyright (c) 2012-2015 Stephen Williams (steve@icarus.com) * * This source code is free software; you can redistribute it * and/or modify it in source code form under the terms of the GNU @@ -344,6 +344,7 @@ vpiHandle vpip_make_queue_var(const char*name, vvp_net_t*net) void darray_delete(vpiHandle item) { class __vpiDarrayVar*obj = dynamic_cast<__vpiDarrayVar*>(item); + if (obj->vals_words) delete [] (obj->vals_words-1); delete obj; }