From 584362406ea7f09c0358f093b9f3efd0f81a0e57 Mon Sep 17 00:00:00 2001 From: "Srivats P." Date: Sun, 22 Jun 2014 10:43:54 +0530 Subject: [PATCH] Fixed a nasty drone crash caused by incorrect usage of qPrintable() in a QtMsgHandler --- rpc/rpcconn.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/rpc/rpcconn.cpp b/rpc/rpcconn.cpp index 5d9ac4d..9cdbd16 100644 --- a/rpc/rpcconn.cpp +++ b/rpc/rpcconn.cpp @@ -307,7 +307,9 @@ void RpcConnection::connIdMsgHandler(QtMsgType type, const char* msg) QString newMsg(*connId.localData()); newMsg.append(msg); newMsg.replace(QChar('\n'), QString("\n").append(*connId.localData())); - msg = qPrintable(newMsg); + fprintf(stderr, "%s\n", qPrintable(newMsg)); + fflush(stderr); + return; } fprintf(stderr, "%s\n", msg);