Details
-
Bug
-
Resolution: Done
-
P2: Important
-
5.6.0 Alpha
-
None
-
Mageia Linux Cauldron x86_64, gcc 5.2.1
-
6ae2bfad41 (qt/qtbase/dev) 6ae2bfad41 (qt/tqtc-qtbase/dev) 28390ce4aa (qt/qtbase/6.4) 28390ce4aa (qt/tqtc-qtbase/6.4) 49de278cd2 (qt/qtbase/6.3) 49de278cd2 (qt/tqtc-qtbase/6.3) 062423a7a1 (qt/tqtc-qtbase/5.15) c5c7daf67a (qt/tqtc-qtbase/6.2)
Description
+underlined text+In the documentation example I see the usage of previous filter. I think, it is meant to use in the following way:
oldCategoryFilter = QLoggingCategory::installFilter(myCategoryFilter);
This code leads to crash, as QLoggingCategory::installFilter() call myCategoryFilter() when oldCategoriFilter is not valid yet.
The workaround is to use this code:
oldCategoryFilter = QLoggingCategory::installFilter(Q_NULLPTR); QLoggingCategory::installFilter(myCategoryFilter);
This is not obvious and looks like a hack, so I think it is either a bug, or should be pointed in documentation.