mirror of
https://github.com/glest/glest-source.git
synced 2025-08-11 19:04:00 +02:00
- bugfix for ircclient segfault using global cache
This commit is contained in:
@@ -4990,6 +4990,7 @@ __try {
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
initSpecialStrings();
|
initSpecialStrings();
|
||||||
|
IRCThread::setGlobalCacheContainerName(GameConstants::ircClientCacheLookupKey);
|
||||||
int result = glestMain(argc, argv);
|
int result = glestMain(argc, argv);
|
||||||
|
|
||||||
if(SystemFlags::VERBOSE_MODE_ENABLED) printf("In [%s::%s Line: %d]\n",__FILE__,__FUNCTION__,__LINE__);
|
if(SystemFlags::VERBOSE_MODE_ENABLED) printf("In [%s::%s Line: %d]\n",__FILE__,__FUNCTION__,__LINE__);
|
||||||
|
@@ -55,6 +55,7 @@ class IRCThread : public BaseThread
|
|||||||
public:
|
public:
|
||||||
static bool debugEnabled;
|
static bool debugEnabled;
|
||||||
protected:
|
protected:
|
||||||
|
static const char *globalCacheContainerName;
|
||||||
|
|
||||||
std::vector<string> argv;
|
std::vector<string> argv;
|
||||||
irc_session_t *ircSession;
|
irc_session_t *ircSession;
|
||||||
@@ -86,6 +87,8 @@ public:
|
|||||||
virtual void signalQuit();
|
virtual void signalQuit();
|
||||||
virtual bool shutdownAndWait();
|
virtual bool shutdownAndWait();
|
||||||
|
|
||||||
|
static void setGlobalCacheContainerName(const char *name) { globalCacheContainerName = name; }
|
||||||
|
|
||||||
void setPlayerName(string value) { playerName = value; }
|
void setPlayerName(string value) { playerName = value; }
|
||||||
string getPlayerName() const { return playerName; }
|
string getPlayerName() const { return playerName; }
|
||||||
|
|
||||||
|
@@ -13,6 +13,7 @@
|
|||||||
#include "ircclient.h"
|
#include "ircclient.h"
|
||||||
#include "util.h"
|
#include "util.h"
|
||||||
#include "platform_common.h"
|
#include "platform_common.h"
|
||||||
|
#include "cache_manager.h"
|
||||||
|
|
||||||
#if !defined(DISABLE_IRCCLIENT)
|
#if !defined(DISABLE_IRCCLIENT)
|
||||||
|
|
||||||
@@ -35,6 +36,7 @@ using namespace Shared::PlatformCommon;
|
|||||||
|
|
||||||
namespace Shared { namespace PlatformCommon {
|
namespace Shared { namespace PlatformCommon {
|
||||||
|
|
||||||
|
const char *IRCThread::globalCacheContainerName = NULL;
|
||||||
const int IRC_SERVER_PORT = 6667;
|
const int IRC_SERVER_PORT = 6667;
|
||||||
//bool IRCThread::debugEnabled = true;
|
//bool IRCThread::debugEnabled = true;
|
||||||
bool IRCThread::debugEnabled = false;
|
bool IRCThread::debugEnabled = false;
|
||||||
@@ -697,6 +699,11 @@ void IRCThread::execute() {
|
|||||||
|
|
||||||
IRCThread::~IRCThread() {
|
IRCThread::~IRCThread() {
|
||||||
if(SystemFlags::VERBOSE_MODE_ENABLED) printf("In ~IRCThread() ...\n");
|
if(SystemFlags::VERBOSE_MODE_ENABLED) printf("In ~IRCThread() ...\n");
|
||||||
|
|
||||||
|
if(IRCThread::globalCacheContainerName != NULL) {
|
||||||
|
IRCThread * &ircClient = CacheManager::getCachedItem< IRCThread * >(IRCThread::globalCacheContainerName);
|
||||||
|
ircClient = NULL;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void normalizeNick(char *nick) {
|
void normalizeNick(char *nick) {
|
||||||
|
Reference in New Issue
Block a user