]> git.jsancho.org Git - lugaru.git/blobdiff - Source/main.cpp
Disabling exception catching when building debug, to ease gdb use
[lugaru.git] / Source / main.cpp
index e0bf4309188959db1be8b8f52e1946faeaa20e0e..4ad68539203a1276274f91976449a7a26f7f8728 100644 (file)
@@ -626,7 +626,9 @@ int main(int argc, char **argv)
 
     LOGFUNC;
 
-    //~ try {
+#ifndef NDEBUG
+    try {
+#endif
         {
             newGame();
 
@@ -677,16 +679,18 @@ int main(int argc, char **argv)
         CleanUp ();
 
         return 0;
-    //~ } catch (const std::exception& error) {
-        //~ CleanUp();
+#ifndef NDEBUG
+    } catch (const std::exception& error) {
+        CleanUp();
 
-        //~ std::string e = "Caught exception: ";
-        //~ e += error.what();
+        std::string e = "Caught exception: ";
+        e += error.what();
 
-        //~ LOG(e);
+        LOG(e);
 
-        //~ SDL_ShowSimpleMessageBox(SDL_MESSAGEBOX_ERROR, "Exception catched", error.what(), NULL);
+        SDL_ShowSimpleMessageBox(SDL_MESSAGEBOX_ERROR, "Exception catched", error.what(), NULL);
 
-        //~ return -1;
-    //~ }
+        return -1;
+    }
+#endif
 }