diff options
author | Dominik Holland <dominik.holland@pelagicore.com> | 2016-08-19 10:21:04 +0200 |
---|---|---|
committer | Dominik Holland <dominik.holland@pelagicore.com> | 2016-08-19 09:26:01 +0000 |
commit | a0df3d1e783589371dd9f961bd59affea60f7291 (patch) | |
tree | 5bb692a1407eb6dcf29d88a528178b0a80d80636 /src/geniviextras/qdltregistration.cpp | |
parent | 2b3db9ff9ae1eaf3ea4b9363b9bfa214e2790112 (diff) |
DLT: Add more checks before trying to register the Logging Category
We need to make sure that the DLT Application is registered before any
category. Also it could happen that someone tries to register an
empty LoggingCategory, which needs to be prevented
Change-Id: I3c084ee4366cc6c21619e8c1d8642916799613e6
Reviewed-by: Robert Griebl <robert.griebl@pelagicore.com>
Diffstat (limited to 'src/geniviextras/qdltregistration.cpp')
-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 9644ff5..1efb658 100644 --- a/src/geniviextras/qdltregistration.cpp +++ b/src/geniviextras/qdltregistration.cpp @@ -167,6 +167,9 @@ void QDltRegistration::registerApplication(const char *dltAppID, const char *dlt void QDltRegistration::registerCategory(const QLoggingCategory* category, const char *dltCtxName, const char *dltCtxDescription) { Q_D(QDltRegistration); + Q_ASSERT_X(!d->m_dltAppID.isEmpty(), "registerCategory", "A DLT Application needs to be registered before registering a Logging Category"); + Q_ASSERT(category); + Q_ASSERT(strlen(category->categoryName()) != 0); //TODO memory leak d->registerCategory(category, new DltContext, dltCtxName, dltCtxDescription); } |