aboutsummaryrefslogtreecommitdiff
path: root/src/client.cpp
diff options
context:
space:
mode:
authorPerttu Ahola <celeron55@gmail.com>2010-12-27 14:34:17 +0200
committerPerttu Ahola <celeron55@gmail.com>2010-12-27 14:34:17 +0200
commitfa64103aa87a8f0f2a3351bb4a54e93e8ade1082 (patch)
tree689986c383e3444cba35a16864e03f61593c5686 /src/client.cpp
parent847a4227b850bc943d11c5b8191fb6bcbce1920a (diff)
downloadminetest-fa64103aa87a8f0f2a3351bb4a54e93e8ade1082.tar.xz
better debug output in segfaults and stack overflows in windows
Diffstat (limited to 'src/client.cpp')
-rw-r--r--src/client.cpp34
1 files changed, 11 insertions, 23 deletions
diff --git a/src/client.cpp b/src/client.cpp
index af2b375f4..4792490f9 100644
--- a/src/client.cpp
+++ b/src/client.cpp
@@ -31,34 +31,22 @@ void * ClientUpdateThread::Thread()
ThreadStarted();
DSTACK(__FUNCTION_NAME);
-
-#if CATCH_UNHANDLED_EXCEPTIONS
- try
+
+ BEGIN_DEBUG_EXCEPTION_HANDLER
+
+ while(getRun())
{
-#endif
- while(getRun())
- {
- m_client->asyncStep();
+ m_client->asyncStep();
- //m_client->updateSomeExpiredMeshes();
+ //m_client->updateSomeExpiredMeshes();
- bool was = m_client->AsyncProcessData();
+ bool was = m_client->AsyncProcessData();
- if(was == false)
- sleep_ms(10);
- }
-#if CATCH_UNHANDLED_EXCEPTIONS
+ if(was == false)
+ sleep_ms(10);
}
- /*
- This is what has to be done in threads to get suitable debug info
- */
- catch(std::exception &e)
- {
- dstream<<std::endl<<DTIME<<"An unhandled exception occurred: "
- <<e.what()<<std::endl;
- assert(0);
- }
-#endif
+
+ END_DEBUG_EXCEPTION_HANDLER
return NULL;
}