Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions Server/Components/Console/console_impl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ class ConsoleComponent final : public IConsoleComponent, public CoreEventHandler
{
std::atomic_bool valid;
ConsoleComponent* component;
std::atomic_bool isRunning;
};

ICore* core = nullptr;
Expand Down Expand Up @@ -211,7 +212,7 @@ class ConsoleComponent final : public IConsoleComponent, public CoreEventHandler

NetCode::Packet::PlayerRconCommand::addEventHandler(*core, &playerRconCommandHandler);

threadData = new ThreadProcData { true, this };
threadData = new ThreadProcData { true, this, true };
cinThread = std::thread(ThreadProc, threadData);
nativeThreadHandle = cinThread.native_handle();
cinThread.detach();
Expand Down Expand Up @@ -249,6 +250,7 @@ class ConsoleComponent final : public IConsoleComponent, public CoreEventHandler
}
else
{
threadData->isRunning = false;
return;
}
}
Expand All @@ -266,7 +268,10 @@ class ConsoleComponent final : public IConsoleComponent, public CoreEventHandler
cinThread.join();
}
#else
pthread_cancel(nativeThreadHandle);
if (threadData->isRunning)
{
pthread_cancel(nativeThreadHandle);
}
#endif

delete threadData;
Expand Down
1 change: 1 addition & 0 deletions Server/Components/Pawn/Plugin/Plugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
*/

#include "Plugin.h"
#include <cstdarg>
#include "../Manager/Manager.hpp"

#ifdef WIN32
Expand Down