Add support to free an automatic object (valgrind)

Add missing code to free an object that is used in an automatic context.

Also remove one compiler warning.
This commit is contained in:
Cary R 2013-04-30 11:45:51 -07:00
parent de6c57d661
commit c55eb37148
2 changed files with 6 additions and 4 deletions

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2004-2010,2012 Stephen Williams (steve@icarus.com)
* Copyright (c) 2004-2013 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
@ -681,7 +681,9 @@ vvp_fun_signal_object_sa::vvp_fun_signal_object_sa()
#ifdef CHECK_WITH_VALGRIND
void vvp_fun_signal_object_aa::free_instance(vvp_context_t context)
{
// Never knew how to do this!
vvp_object_t*bits = static_cast<vvp_object_t*>
(vvp_get_context_item(context, context_idx_));
delete bits;
}
#endif

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2012 Stephen Williams (steve@icarus.com)
* Copyright (c) 2012-2013 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
@ -35,7 +35,7 @@ vvp_object::~vvp_object()
total_active_cnt_ -= 1;
}
void vvp_object::shallow_copy(const vvp_object*that)
void vvp_object::shallow_copy(const vvp_object*)
{
assert(0);
}