[vlmc-devel] Restore QtMessageHandler before deleting VlmcLogger

Yikai Lu git at videolan.org
Wed Jun 29 12:08:20 CEST 2016


vlmc | branch: master | Yikai Lu <luyikei.qmltu at gmail.com> | Wed Jun 29 17:59:28 2016 +0900| [a366338f09d38badbf1472b4405f2f0d08ed5290] | committer: Yikai Lu

Restore QtMessageHandler before deleting VlmcLogger

> https://code.videolan.org/videolan/vlmc/commit/a366338f09d38badbf1472b4405f2f0d08ed5290
---

 src/Tools/VlmcLogger.cpp | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/src/Tools/VlmcLogger.cpp b/src/Tools/VlmcLogger.cpp
index a898f8a..9925065 100644
--- a/src/Tools/VlmcLogger.cpp
+++ b/src/Tools/VlmcLogger.cpp
@@ -38,6 +38,7 @@ VlmcLogger::VlmcLogger()
 
 VlmcLogger::~VlmcLogger()
 {
+    qInstallMessageHandler( 0 );
     if ( m_logFile )
         fclose( m_logFile );
 }
@@ -133,8 +134,6 @@ VlmcLogger::vlmcMessageHandler( QtMsgType type, const QMessageLogContext&, const
 {
     const QByteArray byteArray = str.toLocal8Bit();
     const char* msg = byteArray.constData();
-    //FIXME: This is ok as long as we guarantee no log message will arrive after
-    // we uninstall the hook
 
     VlmcLogger* self = Core::instance()->logger();
     if ( self->m_logFile != nullptr )



More information about the Vlmc-devel mailing list