Since C++20 it is deprecated to implicitly capture this with [=] lambda
copy expressions.
See: https://en.cppreference.com/w/cpp/language/lambda#Lambda_capture
This patch replaces these occurances with [this] where only this is
required and [=, this] where more scope is required.
In case only this and another variable is required in the scope I chose
to use that variable explicitly in favor of =.
This fixes the GCC14 warning: implicit capture of ‘this’ via ‘[=]’ is deprecated in C++20 [-Wdeprecated].
This is enabled with the VIRCADIA_THREAD_DEBUGGING environment variable.
It's incompatible with VIRCADIA_MEMORY_DEBUGGING, so only one of those
can be enabled for a build.
That flag caused a DLL to be loaded before Application was
instanced.
This triggers a Qt bug inside Q_COREAPP_STARTUP_FUNC that causes
the previous registration pointing the startup function in
the main executable to be overridden with the address of the
function in the DLL (Since they both link the same static
library)
This leads to the correct function running in the wrong address
space (the DLLs), hence not initializing some global variables
correctly.