Coverity complained about this and I added compiler directives to
suppress the unused var when I first wrote this, but in fact the
variable is unnecessary and this is the correct way.
The solution in place was working but it was flawed in that unlike
with normal lua callbacks, the callbacks would find the userdata
with a pointer to themselves as the first item on the stack. This
breaks the normal lua stack discipline for callback functions.
This commit makes it work normally, removing the stack entry for
the function before it is called, and also making a local copy
of the function pointer in case the lua garbage collector should
deallocate and destroy it when it is removed from the stack.
In CMake the notifications are enabled by default, switching them to
disabled didn't clear the LIBDBUS_FOUND flag properly causing the
the compilation to fail due to the #error in
src/desktop/dbus_notification.cpp.
we don't need to restart the turn if it wasn't local before and isnt
local now.
Also we change the conditional structure which should have no effect on
the resulting code.
variable v does not exist... the function is not commented so I
can't be sure of the intention, but the most backwards-compatible
fix is to not pass argument v, so that it will be nil as before.
this bug was revealed by enabling lua "strict mode"
Enables an ilua feature called "strict mode" in all of our lua
environments. This change causes lua to report an error if a global
variable is used before it is assigned. The benefits of this are:
- Improved maintainability of lua-based add-ons, since you get
better error reporting in case of a typo.
- Improved behavior of the lua interpreter console, since mistyped
or gibberish lines resolve to an error rather than "nil", which
the console treats as a legal return value.
It is possible to disable this or work around it in individual
scripts. For more info see release notes.