aboutsummaryrefslogtreecommitdiff
path: root/qmidiplayer-desktop
diff options
context:
space:
mode:
authorGravatar Chris Xiong <chirs241097@gmail.com> 2019-12-02 01:19:30 +0800
committerGravatar Chris Xiong <chirs241097@gmail.com> 2019-12-02 01:19:30 +0800
commitc34daa26c67f4a879ff541775c099ddc19a1dec5 (patch)
treec7ee978b1d7c880ca8be746ba5dfd3d887239d95 /qmidiplayer-desktop
parent59acbd03eaf082cea6c751ac6a759724bc3dc68f (diff)
downloadQMidiPlayer-c34daa26c67f4a879ff541775c099ddc19a1dec5.tar.xz
Add a stack trace printer for the beloved operating system.
Diffstat (limited to 'qmidiplayer-desktop')
-rw-r--r--qmidiplayer-desktop/main.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/qmidiplayer-desktop/main.cpp b/qmidiplayer-desktop/main.cpp
index 37f6338..b1c9149 100644
--- a/qmidiplayer-desktop/main.cpp
+++ b/qmidiplayer-desktop/main.cpp
@@ -22,11 +22,16 @@
#include <QLibraryInfo>
#include <QCommandLineParser>
#ifdef _WIN32
+#include <cstdio>
#include <windows.h>
#endif
int main(int argc,char **argv)
{
+#ifdef _WIN32
+ if(!LoadLibraryA("libbacktrace.dll"))
+ fputs("Failed to load backtrace library. Stack trace will not be printed if unhandled exception occurs.\n",stderr);
+#endif
QCoreApplication::setAttribute(Qt::AA_UseHighDpiPixmaps);
QCoreApplication::setApplicationName("qmidiplayer");
QCoreApplication::setApplicationVersion(APP_VERSION);