Private
Public Access
2
0

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:
Kurt Eckhardt
2014-12-06 07:58:00 -08:00
committed by Brendan Le Foll
parent 1ee0548587
commit cf1a8645f7

View File

@@ -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);
}