server, target, cortex_m: add deinit_target to the API to free resources

This should facilitate dynamic target creation and removal.

Currently it helps with getting 0 bytes lost report from Valgrind on
exit (after talking to a nucleo board). However, 1,223,886 bytes in
5,268 blocks are still reachable which means the app holds pointers to
that data on exit. The majority comes from the jtag command queue,
there're also many blocks from TCL command registration.

Change-Id: I7523234bb90fffd26f7d29cdd7648ddd221d46ab
Signed-off-by: Paul Fertser <fercerpav@gmail.com>
Reviewed-on: http://openocd.zylin.com/2544
Tested-by: jenkins
Reviewed-by: Stian Skjelstad <stian@nixia.no>
This commit is contained in:
Paul Fertser
2015-02-11 11:08:40 +03:00
parent ebe9b7a661
commit 2d998c0944
7 changed files with 50 additions and 0 deletions

View File

@@ -780,6 +780,7 @@ struct target_type hla_target = {
.deprecated_name = "stm32_stlink",
.init_target = adapter_init_target,
.deinit_target = cortex_m_deinit_target,
.target_create = adapter_target_create,
.examine = cortex_m_examine,
.commands = adapter_command_handlers,