https://bugs.kde.org/show_bug.cgi?id=400330

--- Comment #7 from Andrius Štikonas <andr...@stikonas.eu> ---
(In reply to Christoph Vogtländer from comment #6)
> I launched my favorite debugger and found the problem:
> mainwindow.cpp:1006: QLatin1String fsName =
> QLatin1String(rePartition.captured(4).toLatin1());
> 
> From the Qt documentation:
> QLatin1String::QLatin1String(const QByteArray &str)
> Constructs a QLatin1String object that stores str.
> **The string data is not copied. The caller must be able to guarantee that
> str will not be deleted or modified as long as the QLatin1String object
> exists.**
> 
> So it is a mistake to construct a QLatin1String from a temporary.
> 
> As "fsType" is required to be a QString later anyway, a possible fix would
> be to simply create a QString:
> QString fsName = rePartition.captured(4);
> 
> I tested this and it works.
> 
> But, this has explicitly changed in 4b4198c34a9f4880546242de330138cc11da8359
> together with the creation of "fs*". The latter was reverted in
> 24237a6120e31f1051a07499f04c7391b877552c

Oh thanks for debugging this! I just started looking at this issue a few
minutes ago. But you already finished investigation

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to