From 05c9827f43cdea9359cc721b223e2beac1535ca8 Mon Sep 17 00:00:00 2001 From: Unnamed Date: Thu, 21 Feb 2019 12:18:21 +0000 Subject: [PATCH] Paint.cpp: execute single command from command stack on Paint Possible workaround for crash that happens with very low amount of free memory available --- src/hooks/Paint.cpp | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/src/hooks/Paint.cpp b/src/hooks/Paint.cpp index 407c2239..ad500c54 100644 --- a/src/hooks/Paint.cpp +++ b/src/hooks/Paint.cpp @@ -58,13 +58,10 @@ DEFINE_HOOKED_METHOD(Paint, void, IEngineVGui *this_, PaintMode_t mode) { PROF_SECTION(PT_command_stack); std::lock_guard guard(hack::command_stack_mutex); - while (!hack::command_stack().empty()) - { - // logging::Info("executing %s", - // hack::command_stack().top().c_str()); - g_IEngine->ClientCmd_Unrestricted(hack::command_stack().top().c_str()); - hack::command_stack().pop(); - } + // logging::Info("executing %s", + // hack::command_stack().top().c_str()); + g_IEngine->ClientCmd_Unrestricted(hack::command_stack().top().c_str()); + hack::command_stack().pop(); } #if ENABLE_TEXTMODE_STDIN == 1 static auto last_stdin = std::chrono::system_clock::from_time_t(0);