diff options
author | Kirill Mitrakhovich <kirill.mitrahovich@yandex.ru> | 2019-09-23 13:15:36 +0200 |
---|---|---|
committer | Kirill Mitrakhovich <kirill.mitrahovich@yandex.ru> | 2019-09-23 14:39:40 +0200 |
commit | 7c7b3749d0dad0c50d36d758e4191309b72ffc64 (patch) | |
tree | 14abf4332ce4525d67909241e9fc8ad37e244eb8 | |
parent | 346d123b3e8c7f0e24fd465a00974f4d2189fd08 (diff) |
geniviextras: Fix potential crash during Qt cleanup V2
Access to static object pointer without checking.
Object might be already destroyed.
Change-Id: Ida459bc0e41f0b475293f2b69c44789f535df549
Reviewed-by: Bernd Weimer <bernd.weimer@pelagicore.com>
-rw-r--r-- | src/geniviextras/qdltregistration.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/geniviextras/qdltregistration.cpp b/src/geniviextras/qdltregistration.cpp index 47abe21..d8dccdc 100644 --- a/src/geniviextras/qdltregistration.cpp +++ b/src/geniviextras/qdltregistration.cpp @@ -55,6 +55,9 @@ QT_BEGIN_NAMESPACE void qtGeniviLogLevelChangedHandler(char context_id[], uint8_t log_level, uint8_t trace_status) { + if (!globalDltRegistration()) + return; + auto d = globalDltRegistration()->d_ptr; d->m_mutex.lock(); const QLoggingCategory *category = d->dltLogLevelChanged(context_id, log_level, trace_status); |