Closed Elv13 closed 7 years ago
There's a bug in the commit. In color_palette.cpp
, QHash<QString,QString>
is changed to QHash<QString,QStringRef>
. However, the QString object referenced by the QStringRef will be deleted on the next iteration of the loop.
But wont the hash be long gone by then and the string "re-referenced" when calling setName()
I'm not sure what you mean. When setName(properties[QStringLiteral("name")].toString())
is called, the returned QStringRef instance will point to memory freed earlier on line 216. QStringRef does not increment a string's reference count and so is only valid when the string it is referencing still exists.
Right, I will report a bug to Clazy about the false positive. They list this one as 100% safe and false positive free. I force pushed a fix
I believe this would break Qt 4 support, right? It isn't an issue, but I'll have to keep in mind to remove the Qt4 checks if this is the case.
I don't mind using a fork either. I guess merging this would cause more issues than it fixes. Shall I close this? The only reason this exists is to lower the warning count in my CI. Other than that, it is 0.1% faster, but who cares.
Nah, it's fine. I'll have to check that everything still works for me though which might take a couple of days.
Looks good to me
There is still many, many more, but at least this covers most of Qt Clazy level 1 and some of the auto-fixit from level2.
Also disables
-Werror
. Werror should be a localCXXFLAGS
/CFLAGS
, not a project one. This break, among other things:-Weverything
(Clang) is enabledclazy