Does GPIO.Cleanup automatically run on exit?

Hi everyone,

I am playing around with Raspberry Pi and notice that the Pi begins to slow down after running a few instances of Xojo programs and after quitting the Pi continues to slow down when another Xojo program instance starts. The speed returns only after a ~15 minute shutdown and then rebooting.

It appears that after reading many articles on the Pi that the GPIO.Cleanup() is frequently used and this method is absent in the GPIO method. Does Xojo automatically call the GPIO.Cleanup () method when the Xojo program exits, or should I just add the Declare in the GPIO?

I am not sure if the speed is related to the Cleanup() method… Just asking :slight_smile:


No, you need to clean up yourself. You could write a function to do this but essentially you want to turn off any outputs you have switched on and turn them back into inputs.

wiringPi does not offer a cleanup method that I can see. Also see this on the RaspberryPi StackExchange.

I can’t think why one would be related to the other. You might get odd results if you don’t cleanup, but that should have nothing to do with speed.

Thanks for the information about the cleanup method Paul. I could just write an algorithm to set the pins back to input and was just curious if one exists. :slight_smile:

Hi Gavin,

Ok, if the two are not related, then I should probably put together a few examples and submit a feedback report. Thanks!