From: Olivier G. <li...@sa...> - 2009-05-20 23:04:30
|
I am encountering a problem where I rise a C++ exception, which consists in a class that sub-subclasses std::exception. The constructor of this exception class is properly called. However, my catch statement is never reached, and the application freeze, entering a dead loop that eats all cpu. QtCreator/gdb doesn't tell anything, no source line, no error message, nothing. The application is multi-threaded, but the throw/catch sequence happens in a single (worker) thread. The general idea: class BaseException: public std::exception { public: BaseException(std::string message) throw() { this->message = message; DEBUG("Exception: %s", message.c_str()); } ~BaseException() throw() {} virtual const char* what() const throw() { return message.c_str(); } protected: std::string message; }; class NotEnoughFramesError: public BaseException { public: NotEnoughFramesError(std::string filename) throw() : BaseException("Not enough frames in sample file: " + filename) {} }; This code works fine on gcc/linux. Is there anything special I should be aware of when dealing with exceptions in mingw? -- Olivier |