[mythtv-commits] [MythTV/mythtv] ce13a3: Fix "null pointer dereference" warning in DTVChann...
noreply at github.com
Thu Sep 24 21:43:51 UTC 2020
Author: Klaas de Waal <kdewaal at mythtv.org>
Date: 2020-09-24 (Thu, 24 Sep 2020)
Fix "null pointer dereference" warning in DTVChannelInfo
Compiling the code with the "-O3" option gives warnings about "null pointer dereference"
for files that use the DTVChannelInfoList defined in dtvconfparser.h.
Although the correctness of the warning in this case can be discussed, it appears
that here the warning is caused by the mixing of Qt and C++ classes.
Note that DTVChannelInfo has a QString but DTVChannelInfoList is a std::vector.
Changing the QString into a std::string, so that only C++ classes are used, does remove the "null pointer dereference" warning.
Changing the std::vector to a QVector, so that only Qt classes are used, does also remove the warning.
Given that QVector but especially QString is used extensively in MythTV the DTVChannelInfoList has been changed into a QVector.
For consistency reasons the DTVChannelList, defined in the same file, has also been changed into a QVector.
More information about the mythtv-commits