The line of my code that causes the crash is this:
Code: Select all
local slice = loadstring(script)()
I have tried removing any code related to the ending of the video (not even testing whether it has ended). The crash still happens (unless the video hasn't finished - then it never crashes).
If I was coding in C then I would suspect some kind of error in my memory handling, but seeing as I basically can't do that in lua then I suspect the video library of some mishandling of something. There is something more that I think probably proves this bug is not of my own making: the exact same code runs fine on someone else's computer (I have Windows 7 and she has Windows 10, we both have the latest Love2d).
I have tried (after the video has played) setting the variable holding the video to nil, and I have tried running garbagecollection(), but this bug still happens. Any advice for how to avoid it gratefully received!