mirror of
https://github.com/amyinspace/MagicSetEditor2.git
synced 2026-06-10 13:06:59 -04:00
Don't show message boxes for assertion failures, since this can lead to crashes when in OnPaint
git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@1197 0fc631ac-6414-0410-93d0-97cfa31319b6
This commit is contained in:
@@ -12,6 +12,25 @@
|
||||
|
||||
DECLARE_TYPEOF_COLLECTION(ScriptParseError);
|
||||
|
||||
// ----------------------------------------------------------------------------- : Debug utilities
|
||||
|
||||
#if defined(_MSC_VER) && defined(_DEBUG)
|
||||
void msvc_assert(const char* msg, const char* expr, const char* file, unsigned line) {
|
||||
if (IsDebuggerPresent()) {
|
||||
char buffer[1024];
|
||||
if (msg) {
|
||||
sprintf(buffer, "Assertion failed: %s: %s, file %s, line %d\n", msg, expr, file, line);
|
||||
} else {
|
||||
sprintf(buffer, "Assertion failed: %s, file %s, line %d\n", expr, file, line);
|
||||
}
|
||||
OutputDebugStringA(buffer);
|
||||
DebugBreak();
|
||||
} else {
|
||||
_assert(expr, file, line);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
// ----------------------------------------------------------------------------- : Error types
|
||||
|
||||
Error::Error(const String& message)
|
||||
|
||||
Reference in New Issue
Block a user