diff --git a/src/App/Application.cpp b/src/App/Application.cpp index 6ed14d0a5..6c19a5c4d 100644 --- a/src/App/Application.cpp +++ b/src/App/Application.cpp @@ -939,30 +939,34 @@ void segmentation_fault_handler(int sig) switch (sig) { case SIGSEGV: std::cerr << "Illegal storage access..." << std::endl; +#if !defined(_DEBUG) throw Base::Exception("Illegal storage access! Please save your work under a new file name and restart the application!"); +#endif break; case SIGABRT: std::cerr << "Abnormal program termination..." << std::endl; +#if !defined(_DEBUG) throw Base::Exception("Break signal occoured"); +#endif break; default: std::cerr << "Unknown error occurred..." << std::endl; break; } - } void my_terminate_handler() { std::cerr << "Terminating..." << std::endl; - } void unexpection_error_handler() { std::cerr << "Unexpected error occurred..." << std::endl; // try to throw to give the user evantually a change to save +#if !defined(_DEBUG) throw Base::Exception("Unexpected error occurred! Please save your work under a new file name and restart the application!"); +#endif terminate(); } diff --git a/src/Mod/Part/App/AppPart.cpp b/src/Mod/Part/App/AppPart.cpp index 684f73a64..6c17ceb35 100644 --- a/src/Mod/Part/App/AppPart.cpp +++ b/src/Mod/Part/App/AppPart.cpp @@ -116,9 +116,9 @@ void PartExport initPart() // if we have mysterious crashes // The argument must be 'Standard_False' to avoid FPE caused by // Python's cmath module. -//#if defined(FC_OS_LINUX) +#if !defined(_DEBUG) OSD::SetSignal(Standard_False); -//#endif +#endif PyObject* partModule = Py_InitModule3("Part", Part_methods, module_part_doc); /* mod name, table ptr */ Base::Console().Log("Loading Part module... done\n");