From cac8f7a47a105a5583e579b989e3dafd10144734 Mon Sep 17 00:00:00 2001 From: Noel Eck Date: Wed, 29 Mar 2017 22:06:42 -0700 Subject: [PATCH] common.h: Added destructor attribute for deinit Currently, mraa_init is called when loading libmraa. This commit adds similar functionality to call mraa_deinit when unloading libmraa. This is a nice-to-have since it makes identifying other memory leaks easier. Signed-off-by: Noel Eck Signed-off-by: Brendan Le Foll --- api/mraa/common.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/mraa/common.h b/api/mraa/common.h index 290f758..1749ac6 100644 --- a/api/mraa/common.h +++ b/api/mraa/common.h @@ -85,7 +85,7 @@ mraa_result_t mraa_init() __attribute__((constructor)); * people who like super clean code. If dynamically loading & unloading * libmraa you need to call this before unloading the library. */ -void mraa_deinit(); +void mraa_deinit() __attribute__((destructor)); /** * Checks if a pin is able to use the passed in mode.