+ // do check for memory leaks on program exit
+ // (another useful flag is _CRTDBG_DELAY_FREE_MEM_DF which doesn't free
+ // deallocated memory which may be used to simulate low-memory condition)
+ wxCrtSetDbgFlag(_CRTDBG_LEAK_CHECK_DF);
+
+ // take everything into a try-except block in release build
+ // FIXME other compilers must support Win32 SEH (structured exception
+ // handling) too, just find the appropriate keyword in their docs!
+ // Please note that it's _not_ the same as C++ exceptions!
+#if !defined(__WXDEBUG__) && defined(__VISUALC__)
+ #define CATCH_PROGRAM_EXCEPTIONS
+
+ __try {
+#else
+ #undef CATCH_PROGRAM_EXCEPTIONS