diff options
author | Jarkko Koivikko <jarkko.koivikko@code-q.fi> | 2015-03-18 13:30:01 +0200 |
---|---|---|
committer | Jarkko Koivikko <jarkko.koivikko@code-q.fi> | 2015-06-17 12:34:39 +0300 |
commit | 454ea496a8c28bd54619c92a616305a849465aba (patch) | |
tree | 19c373a094efcc3fb7fbf1364aa37195207af023 /src/virtualkeyboard/3rdparty | |
parent | 25d8d6e5dfb115dcf65380636f7cef7f5ed96818 (diff) |
lipi-toolkit: Fix crash
Logger caused crash when the library was unloaded.
Change-Id: I4627bbfae069901f148f9f4d833b67fcce67a1dc
Reviewed-by: Gatis Paeglis <gatis.paeglis@theqtcompany.com>
Diffstat (limited to 'src/virtualkeyboard/3rdparty')
-rw-r--r-- | src/virtualkeyboard/3rdparty/lipi-toolkit/src/util/logger/logger.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/virtualkeyboard/3rdparty/lipi-toolkit/src/util/logger/logger.cpp b/src/virtualkeyboard/3rdparty/lipi-toolkit/src/util/logger/logger.cpp index d786db1a..2fa735bb 100644 --- a/src/virtualkeyboard/3rdparty/lipi-toolkit/src/util/logger/logger.cpp +++ b/src/virtualkeyboard/3rdparty/lipi-toolkit/src/util/logger/logger.cpp @@ -113,6 +113,7 @@ LTKLoggerInterface* getLoggerInstance() ***************************************************************************/ void destroyLogger() { + ptrLog = NULL; LTKLogger::destroyLoggerInstance(); } @@ -129,6 +130,7 @@ void destroyLogger() ***************************************************************************/ void setLoggerFileName(const string& logFileName) { + if (!ptrLog) return; ptrLog->setLogFileName(logFileName); } @@ -145,6 +147,7 @@ void setLoggerFileName(const string& logFileName) ***************************************************************************/ int setLoggerLevel(LTKLogger::EDebugLevel logLevel) { + if (!ptrLog) return FAILURE; return ptrLog->setLogLevel(logLevel); } @@ -161,6 +164,8 @@ int setLoggerLevel(LTKLogger::EDebugLevel logLevel) ***************************************************************************/ const string& getLoggerFileName() { + static string emptyStr; + if (!ptrLog) return emptyStr; return ptrLog->getLogFileName(); } @@ -177,6 +182,7 @@ const string& getLoggerFileName() ***************************************************************************/ LTKLogger::EDebugLevel getLoggerLevel() { + if (!ptrLog) return LTKLogger::LTK_LOGLEVEL_OFF; return ptrLog->getLogLevel(); } @@ -193,6 +199,7 @@ LTKLogger::EDebugLevel getLoggerLevel() ***************************************************************************/ void startLogger() { + if (!ptrLog) return; ptrLog->startLog(); } @@ -209,6 +216,7 @@ void startLogger() ***************************************************************************/ void stopLogger() { + if (!ptrLog) return; ptrLog->stopLog(); } @@ -227,5 +235,6 @@ void stopLogger() ostream& logMessage(LTKLogger::EDebugLevel logLevel, const string& fileName, int lineNumber) { + if (!ptrLog) return LTKLoggerUtil::m_emptyStream; return (*ptrLog)(logLevel, fileName, lineNumber); }
\ No newline at end of file |