Private
Public Access
2
0

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 <noel.eck@intel.com>
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
This commit is contained in:
Noel Eck
2017-03-29 22:06:42 -07:00
committed by Brendan Le Foll
parent 65f7d2a250
commit cac8f7a47a

View File

@@ -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.