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

This commit is contained in:
Cary R
2015-01-09 17:38:39 -08:00
parent d29a6d134f
commit e61ed48914
+2 -1
View File
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2012-2014 Stephen Williams ([email protected])
* Copyright (c) 2012-2015 Stephen Williams ([email protected])
*
* 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;
}