diff mbox

[3/3] example: traffic_mgmt: add termination path

Message ID 1469675371-20274-3-git-send-email-forrest.shi@linaro.org
State New
Headers show

Commit Message

Forrest Shi July 28, 2016, 3:09 a.m. UTC
From: Xuelin Shi <forrest.shi@linaro.org>


release resources on exit

Signed-off-by: Xuelin Shi <forrest.shi@linaro.org>

---
 example/traffic_mgmt/odp_traffic_mgmt.c | 11 +++++++++++
 1 file changed, 11 insertions(+)

-- 
2.1.0.27.g96db324
diff mbox

Patch

diff --git a/example/traffic_mgmt/odp_traffic_mgmt.c b/example/traffic_mgmt/odp_traffic_mgmt.c
index ff03542..6b33560 100644
--- a/example/traffic_mgmt/odp_traffic_mgmt.c
+++ b/example/traffic_mgmt/odp_traffic_mgmt.c
@@ -793,5 +793,16 @@  int main(int argc, char *argv[])
 	printf("pkts_into_tm=%u pkts_from_tm=%u\n", pkts_into_tm, pkts_from_tm);
 
 	odp_tm_stats_print(odp_tm_test);
+
+	if (odp_term_local()) {
+		printf("Error: term local\n");
+		exit(EXIT_FAILURE);
+	}
+
+	if (odp_term_global(instance)) {
+		printf("Error: term global\n");
+		exit(EXIT_FAILURE);
+	}
+
 	return 0;
 }