aio.c: properly cleanup after mraa_aio_close
Problem not closing file handle when you destroy the mraa_aio_context Signed-off-by: Kurt Eckhardt <kurte@rockisland.com> Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
This commit is contained in:
committed by
Brendan Le Foll
parent
1ee0548587
commit
cf1a8645f7
@@ -162,8 +162,11 @@ mraa_aio_read(mraa_aio_context dev)
|
||||
mraa_result_t
|
||||
mraa_aio_close(mraa_aio_context dev)
|
||||
{
|
||||
if (NULL != dev)
|
||||
if (NULL != dev) {
|
||||
if (dev->adc_in_fp != -1)
|
||||
close(dev->adc_in_fp);
|
||||
free(dev);
|
||||
}
|
||||
|
||||
return(MRAA_SUCCESS);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user