Fix security check here as well (stop coby pasting code from gsc utils maybe)

This commit is contained in:
6arelyFuture 2022-04-22 15:44:05 +02:00
parent b48ab294b8
commit 5458381253
Signed by: Future
GPG Key ID: FA77F074E98D98A5

View File

@ -1,10 +1,11 @@
#include <std_include.hpp> #include <std_include.hpp>
#include "../loader/component_loader.hpp" #include "../loader/component_loader.hpp"
#include <utils/thread.hpp>
namespace console { namespace console {
namespace { namespace {
std::thread thread; std::thread thread;
std::thread::id async_thread_id;
LRESULT __stdcall sys_start_console(HWND, UINT, WPARAM, LPARAM) { LRESULT __stdcall sys_start_console(HWND, UINT, WPARAM, LPARAM) {
game::Sys_ShowConsole(); game::Sys_ShowConsole();
@ -29,12 +30,16 @@ void show_console() {
class component final : public component_interface { class component final : public component_interface {
public: public:
void post_unpack() override { void post_unpack() override {
thread = std::thread([]() { thread = utils::thread::create_named_thread("Console Thread", []() {
console_unlock(); console_unlock();
show_console(); show_console();
}); });
}
async_thread_id = thread.get_id(); void pre_destroy() override {
if (thread.joinable()) {
thread.join();
}
} }
}; };
} // namespace console } // namespace console