Clean up vals_words when a dynamic array is accessed using the vpi

This commit is contained in:
Cary R 2015-01-09 17:35:33 -08:00
parent d29a6d134f
commit e61ed48914
1 changed files with 2 additions and 1 deletions

View File

@ -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;
}