vlc | branch: master | Rémi Denis-Courmont <[email protected]> | Sun Feb 11 
16:45:35 2018 +0200| [a60834c4746357449a5a961e0dbc4b0c3a74ad6f] | committer: 
Rémi Denis-Courmont

qt: use custom message handler for VLC Qt check

Some versions of Qt abort the process on fatal error, possibly leading
core dumping. This installs a dummy handler that will exit the process
rather call abort() regardless of the Qt default handler.

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=a60834c4746357449a5a961e0dbc4b0c3a74ad6f
---

 modules/gui/qt/vlc-qt-check.cpp | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/modules/gui/qt/vlc-qt-check.cpp b/modules/gui/qt/vlc-qt-check.cpp
index 685238c88b..52a7f4a78b 100644
--- a/modules/gui/qt/vlc-qt-check.cpp
+++ b/modules/gui/qt/vlc-qt-check.cpp
@@ -22,9 +22,18 @@
 # include "config.h"
 #endif
 
+#include <stdlib.h>
 #include <QApplication>
 
+static void messageOutput(QtMsgType type, const QMessageLogContext &,
+                          const QString &)
+{
+    if (type == QtFatalMsg)
+        exit(1);
+}
+
 int main(int argc, char *argv[])
 {
+    qInstallMessageHandler(messageOutput);
     QApplication app(argc, argv);
 }

_______________________________________________
vlc-commits mailing list
[email protected]
https://mailman.videolan.org/listinfo/vlc-commits

Reply via email to