collectgarbage app crash

\<Warning\>: Runtime error attempt to call a table value stack traceback: [C]: in function '?' ?: in function 'collectgarbage'

I got the error message, while the app was crashing from calling:

&nbsp; &nbsp; &nbsp; &nbsp;collectgarbage('collect')

are there times, when collectgarbage(‘collect’)  is not a good idea to call?

Cheers,

Phil

That’s an odd one.  I don’t think I’ve seen that happen.  When are you calling it?  Are you calling it while somethings are being destroyed?  In a completion handler?  What happens if you put it in a timer.performWithDelay() with just a few milliseconds delay?

Rob

Hej Rob,

yes, I had the same idea calling a timer.performWithDelay() and it seems to work right now.

Thanks for the help, as always :slight_smile:

Phil

That’s an odd one.  I don’t think I’ve seen that happen.  When are you calling it?  Are you calling it while somethings are being destroyed?  In a completion handler?  What happens if you put it in a timer.performWithDelay() with just a few milliseconds delay?

Rob

Hej Rob,

yes, I had the same idea calling a timer.performWithDelay() and it seems to work right now.

Thanks for the help, as always :slight_smile:

Phil