From c55eb37148f41f9aeecc80313245f211eca900b0 Mon Sep 17 00:00:00 2001 From: Cary R Date: Tue, 30 Apr 2013 11:45:51 -0700 Subject: [PATCH] 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. --- vvp/vvp_net_sig.cc | 6 ++++-- vvp/vvp_object.cc | 4 ++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/vvp/vvp_net_sig.cc b/vvp/vvp_net_sig.cc index 4319898bd..2b55f1169 100644 --- a/vvp/vvp_net_sig.cc +++ b/vvp/vvp_net_sig.cc @@ -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_get_context_item(context, context_idx_)); + delete bits; } #endif diff --git a/vvp/vvp_object.cc b/vvp/vvp_object.cc index c691cae17..d4ce0ec82 100644 --- a/vvp/vvp_object.cc +++ b/vvp/vvp_object.cc @@ -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); }