[vlmc-devel] VlmcLogger: Fix crash when running without logfile

Hugo Beauzée-Luyssen git at videolan.org
Sat Mar 1 13:43:34 CET 2014


vlmc | branch: master | Hugo Beauzée-Luyssen <hugo at beauzee.fr> | Sat Mar  1 13:43:03 2014 +0100| [849dbe07b9fdd9998c1fb5a2c193a28c0841d3af] | committer: Hugo Beauzée-Luyssen

VlmcLogger: Fix crash when running without logfile

> http://git.videolan.org/gitweb.cgi/vlmc.git/?a=commit;h=849dbe07b9fdd9998c1fb5a2c193a28c0841d3af
---

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

diff --git a/src/Tools/VlmcLogger.cpp b/src/Tools/VlmcLogger.cpp
index 358df2a..93e3e13 100644
--- a/src/Tools/VlmcLogger.cpp
+++ b/src/Tools/VlmcLogger.cpp
@@ -185,7 +185,8 @@ VlmcLogger::backendLogHandler(void *data, Backend::IBackend::LogLevel logLevel,
     char* newMsg = NULL;
     asprintf( &newMsg, "[%s] T #%p [Backend] %s", qPrintable( QTime::currentTime().toString( "hh:mm:ss.zzz" ) ),
               QThread::currentThreadId(), msg );
-    self->writeToFile( newMsg );
+    if ( self->m_logFile != NULL )
+        self->writeToFile( newMsg );
     if ( logLevel < self->m_backendLogLevel )
     {
         free( newMsg );



More information about the Vlmc-devel mailing list