https://bugs.kde.org/show_bug.cgi?id=507547
--- Comment #5 from Mladen Milinkovic, Max <[email protected]> --- (In reply to Matthias Grimrath from comment #2) > (In reply to Mladen Milinkovic, Max from comment #1) > > I would appreciate exact message that is written - it should says something > > like: > ASSERT: "m_ref != nullptr" in file > /home/matthias/build/subtitlecomposer-upstream/src/core/subtitleline.cpp, > line 230 As I said before I think your compiler is optimizing too much code. I have done exact same test on current arch linux and cannot reproduce the problem. QVector when growing copies the existing values into newly allocated bigger buffer. When vector contains C++ objects it's supposed to copy/move construct them depending if they are *NOT* Q_MOVABLE_TYPE. If they are Q_MOVABLE_TYPE QVector can just memcpy old data to new buffer without calling any constructors. Since ObjectRef is not Q_MOVABLE_TYPE, QVector is supposed to call C++ constructor when growing - which in turns assign m_ref to something non-null on newly created ObjectRef instances. Your build triggering Q_ASSERT(m_ref != nullptr) means that for whatever reason QVector when growing is not constructing C++ objects, but just memcpy-ing their memory. I'm not sure why is that happening, if you feel like investigating you could try building Qt yourself and checking what's going on in qvector.cpp (you will see Q_MOVABLE_TYPE if conditions for optimizations). In any case if you just disable asserts (or remove those two asserts) the code will continue working as it was and it will log that qWarning whenever it it's uynable to correctly calculate index of the element. In that case it will fallback to original for loop that was used to figure out the subtitle line index. -- You are receiving this mail because: You are watching all bug changes.
