Closed EngineerSmith closed 2 years ago
But if you look at the code above that, you'll see this: https://github.com/love2d/love/blob/8e7fd10b6fd9b6dce6d61d728271019c28a7213e/src/modules/thread/LuaThread.cpp#L89-L90 I might be wrong, but, onError gets called by that if error's not empty... yet inside onError, it is tested if it's empty again, which it can't be?
There's probably other cases onError may be triggered
In any case, i'd assume that an empty error call should still pass an empty string to threaderror since an error was raised.
Yes, I think the core problem with the code is that it's using the error
string variable to store the error message and as a flag to check if an error has occurred, so it assumes there's no error if the error message is empty. It should fix the bug if those two concepts are split up (for example by adding a didError
boolean variable or something.)
The above code doesn't show default
love.threaderror
as expected (or a custom setlove.threaderror
). Not a massive bug - but something to be aware of if no error message is given