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:
committed by
Brendan Le Foll
parent
65f7d2a250
commit
cac8f7a47a
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user