Fixed lua crash caused by lion with optimizations

This commit is contained in:
Anonymous275
2021-02-23 00:29:15 +02:00
committed by Anonymous275
parent f52308c439
commit 9b1bf071a8
11 changed files with 29 additions and 29 deletions

View File

@@ -12,7 +12,7 @@
class TLuaEngine : public IThreaded {
public:
explicit TLuaEngine(TServer& Server, TTCPServer& TCPServer, TUDPServer& UDPServer);
~TLuaEngine();
//~TLuaEngine();
using TSetOfLuaFile = std::set<std::unique_ptr<TLuaFile>>;

View File

@@ -20,7 +20,7 @@ class TLuaEngine;
class TLuaFile {
public:
void Init();
void Load();
void RegisterEvent(const std::string& Event, const std::string& FunctionName);
void UnRegisterEvent(const std::string& Event);
void SetLastWrite(fs::file_time_type time);
@@ -33,7 +33,7 @@ public:
std::string GetOrigin();
std::mutex Lock;
void Reload();
TLuaFile(TLuaEngine& Engine, const std::string& PluginName, const std::string& FileName, fs::file_time_type LastWrote, bool Console = false);
void Init(const std::string& PluginName, const std::string& FileName, fs::file_time_type LastWrote);
explicit TLuaFile(TLuaEngine& Engine, bool Console = false);
~TLuaFile();
void SetStopThread(bool StopThread) { mStopThread = StopThread; }

View File

@@ -18,14 +18,14 @@ public:
TServer(int argc, char** argv);
void InsertClient(std::shared_ptr<TClient> Ptr);
void InsertClient(const std::shared_ptr<TClient>& Ptr);
std::weak_ptr<TClient> InsertNewClient();
void RemoveClient(std::weak_ptr<TClient>);
void RemoveClient(const std::weak_ptr<TClient>&);
// in Fn, return true to continue, return false to break
void ForEachClient(const std::function<bool(std::weak_ptr<TClient>)>& Fn);
size_t ClientCount() const;
static void GlobalParser(std::weak_ptr<TClient> Client, std::string Packet, TPPSMonitor& PPSMonitor, TUDPServer& UDPServer, TTCPServer& TCPServer);
static void GlobalParser(const std::weak_ptr<TClient>& Client, std::string Packet, TPPSMonitor& PPSMonitor, TUDPServer& UDPServer, TTCPServer& TCPServer);
static void HandleEvent(TClient& c, const std::string& Data);
private: