gpio.c: fix segfault on isrExit in python because of double Py_DECREF
authorBrendan Le Foll <brendan.le.foll@intel.com>
Tue, 1 Sep 2015 13:54:38 +0000 (14:54 +0100)
committerBrendan Le Foll <brendan.le.foll@intel.com>
Tue, 1 Sep 2015 13:56:14 +0000 (14:56 +0100)
Py_DECREF is not required here as no interpreter is clever enough to handle
this reference causing a double free on isrExit(). Closes #265

Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
src/gpio/gpio.c

index 58ccfe6..eb31a96 100644 (file)
@@ -320,11 +320,6 @@ mraa_gpio_isr_exit(mraa_gpio_context dev)
         }
     }
 
-#ifdef SWIGPYTHON
-    // Dereference our Python call back function
-    Py_DECREF(dev->isr);
-#endif
-
     // assume our thread will exit either way we just lost it's handle
     dev->thread_id = 0;
     dev->isr_value_fp = -1;