simavr: Deallocate resources
authorMichel Pollet <buserror@gmail.com>
Thu, 2 Sep 2010 11:56:29 +0000 (12:56 +0100)
committerMichel Pollet <buserror@gmail.com>
Thu, 2 Sep 2010 11:56:29 +0000 (12:56 +0100)
Deallocate memory and IO modules at teardown

Signed-off-by: Michel Pollet <buserror@gmail.com>
simavr/sim/sim_avr.c

index d15f7f2..73883d4 100644 (file)
@@ -53,6 +53,11 @@ void avr_terminate(avr_t * avr)
        if (avr->vcd)
                avr_vcd_close(avr->vcd);
        avr->vcd = NULL;
+       avr_deallocate_ios(avr);
+
+       free(avr->flash);
+       free(avr->data);
+       avr->flash = avr->data = NULL;
 }
 
 void avr_reset(avr_t * avr)