mirror of
https://github.com/glest/glest-source.git
synced 2025-08-17 21:51:17 +02:00
- attempt to fix irc thread cleanup
This commit is contained in:
@@ -736,12 +736,15 @@ void IRCThread::execute() {
|
|||||||
{
|
{
|
||||||
RunningStatusSafeWrapper runningStatus(this);
|
RunningStatusSafeWrapper runningStatus(this);
|
||||||
if(SystemFlags::getSystemSettingType(SystemFlags::debugNetwork).enabled) SystemFlags::OutputDebug(SystemFlags::debugNetwork,"In [%s::%s Line: %d] argv.size() = %d\n",__FILE__,__FUNCTION__,__LINE__,argv.size());
|
if(SystemFlags::getSystemSettingType(SystemFlags::debugNetwork).enabled) SystemFlags::OutputDebug(SystemFlags::debugNetwork,"In [%s::%s Line: %d] argv.size() = %d\n",__FILE__,__FUNCTION__,__LINE__,argv.size());
|
||||||
|
if(SystemFlags::VERBOSE_MODE_ENABLED || IRCThread::debugEnabled) printf ("===> IRC: IRCThread::execute Line: %d\n", __LINE__);
|
||||||
|
|
||||||
if(getQuitStatus() == true) {
|
if(getQuitStatus() == true) {
|
||||||
|
if(SystemFlags::VERBOSE_MODE_ENABLED || IRCThread::debugEnabled) printf ("===> IRC: Line: %d\n", __LINE__);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(SystemFlags::getSystemSettingType(SystemFlags::debugNetwork).enabled) SystemFlags::OutputDebug(SystemFlags::debugNetwork,"IRC thread is running\n");
|
if(SystemFlags::getSystemSettingType(SystemFlags::debugNetwork).enabled) SystemFlags::OutputDebug(SystemFlags::debugNetwork,"IRC thread is running\n");
|
||||||
|
if(SystemFlags::VERBOSE_MODE_ENABLED || IRCThread::debugEnabled) printf ("===> IRC: Line: %d\n", __LINE__);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
#if !defined(DISABLE_IRCCLIENT)
|
#if !defined(DISABLE_IRCCLIENT)
|
||||||
@@ -780,6 +783,7 @@ void IRCThread::execute() {
|
|||||||
callbacks.event_dcc_send_req = irc_event_dcc_send;
|
callbacks.event_dcc_send_req = irc_event_dcc_send;
|
||||||
|
|
||||||
if(this->getQuitStatus() == true) {
|
if(this->getQuitStatus() == true) {
|
||||||
|
if(SystemFlags::VERBOSE_MODE_ENABLED || IRCThread::debugEnabled) printf ("===> IRC: Line: %d\n", __LINE__);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
safeMutex.Lock();
|
safeMutex.Lock();
|
||||||
@@ -817,6 +821,8 @@ void IRCThread::execute() {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(SystemFlags::VERBOSE_MODE_ENABLED || IRCThread::debugEnabled) printf ("===> IRC: Line: %d\n", __LINE__);
|
||||||
|
|
||||||
safeMutex.Lock();
|
safeMutex.Lock();
|
||||||
if(irc_connect(ircSession, argv[0].c_str(), IRC_SERVER_PORT, 0, this->nick.c_str(), this->username.c_str(), "megaglest")) {
|
if(irc_connect(ircSession, argv[0].c_str(), IRC_SERVER_PORT, 0, this->nick.c_str(), this->username.c_str(), "megaglest")) {
|
||||||
safeMutex.ReleaseLock();
|
safeMutex.ReleaseLock();
|
||||||
@@ -825,6 +831,8 @@ void IRCThread::execute() {
|
|||||||
}
|
}
|
||||||
safeMutex.ReleaseLock();
|
safeMutex.ReleaseLock();
|
||||||
|
|
||||||
|
if(SystemFlags::VERBOSE_MODE_ENABLED || IRCThread::debugEnabled) printf ("===> IRC: Line: %d\n", __LINE__);
|
||||||
|
|
||||||
if(this->getQuitStatus() == true) {
|
if(this->getQuitStatus() == true) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -834,6 +842,7 @@ void IRCThread::execute() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
//printf("In ~IRCThread Line: %d [%p]\n",__LINE__,this);
|
//printf("In ~IRCThread Line: %d [%p]\n",__LINE__,this);
|
||||||
|
if(SystemFlags::VERBOSE_MODE_ENABLED || IRCThread::debugEnabled) printf ("===> IRC: Line: %d\n", __LINE__);
|
||||||
|
|
||||||
for(int iAttempts=1;
|
for(int iAttempts=1;
|
||||||
this->getQuitStatus() == false && iAttempts <= 7; ++iAttempts) {
|
this->getQuitStatus() == false && iAttempts <= 7; ++iAttempts) {
|
||||||
@@ -848,6 +857,8 @@ void IRCThread::execute() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(SystemFlags::VERBOSE_MODE_ENABLED || IRCThread::debugEnabled) printf ("===> IRC: Line: %d\n", __LINE__);
|
||||||
|
|
||||||
//printf("In ~IRCThread Line: %d [%p]\n",__LINE__,this);
|
//printf("In ~IRCThread Line: %d [%p]\n",__LINE__,this);
|
||||||
#else
|
#else
|
||||||
for(;this->getQuitStatus() == false;) {
|
for(;this->getQuitStatus() == false;) {
|
||||||
@@ -867,8 +878,9 @@ void IRCThread::execute() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if(SystemFlags::getSystemSettingType(SystemFlags::debugNetwork).enabled) SystemFlags::OutputDebug(SystemFlags::debugNetwork,"In [%s::%s Line: %d] IRC thread is exiting\n",__FILE__,__FUNCTION__,__LINE__);
|
if(SystemFlags::getSystemSettingType(SystemFlags::debugNetwork).enabled) SystemFlags::OutputDebug(SystemFlags::debugNetwork,"In [%s::%s Line: %d] IRC thread is exiting\n",__FILE__,__FUNCTION__,__LINE__);
|
||||||
|
if(SystemFlags::VERBOSE_MODE_ENABLED || IRCThread::debugEnabled) printf ("===> IRC: Line: %d\n", __LINE__);
|
||||||
//printf("In ~IRCThread Line: %d [%p]\n",__LINE__,this);
|
//printf("In ~IRCThread Line: %d [%p]\n",__LINE__,this);
|
||||||
}
|
|
||||||
|
|
||||||
//printf("In ~IRCThread Line: %d [%p]\n",__LINE__,this);
|
//printf("In ~IRCThread Line: %d [%p]\n",__LINE__,this);
|
||||||
// Delete ourself when the thread is done (no other actions can happen after this
|
// Delete ourself when the thread is done (no other actions can happen after this
|
||||||
@@ -877,10 +889,12 @@ void IRCThread::execute() {
|
|||||||
IRCCallbackInterface *cb = getCallbackObj(false);
|
IRCCallbackInterface *cb = getCallbackObj(false);
|
||||||
if(cb != NULL) {
|
if(cb != NULL) {
|
||||||
//printf("In ~IRCThread Line: %d [%p]\n",__LINE__,this);
|
//printf("In ~IRCThread Line: %d [%p]\n",__LINE__,this);
|
||||||
|
if(SystemFlags::VERBOSE_MODE_ENABLED || IRCThread::debugEnabled) printf ("===> IRC: Line: %d\n", __LINE__);
|
||||||
cb->IRC_CallbackEvent(IRC_evt_exitThread, NULL, NULL, 0);
|
cb->IRC_CallbackEvent(IRC_evt_exitThread, NULL, NULL, 0);
|
||||||
}
|
}
|
||||||
safeMutex.ReleaseLock();
|
safeMutex.ReleaseLock();
|
||||||
|
|
||||||
|
}
|
||||||
//printf("In ~IRCThread Line: %d [%p]\n",__LINE__,this);
|
//printf("In ~IRCThread Line: %d [%p]\n",__LINE__,this);
|
||||||
|
|
||||||
if(SystemFlags::VERBOSE_MODE_ENABLED) printf("In IRCThread() calling delete ...\n");
|
if(SystemFlags::VERBOSE_MODE_ENABLED) printf("In IRCThread() calling delete ...\n");
|
||||||
|
Reference in New Issue
Block a user