crash inside LyricsApplet::sizeHint

Vyacheslav Tokarev tsjoker at gmail.com
Sun Jan 18 04:15:35 UTC 2009


Hi, all

With latest qt4.5 and amarok from trunk I got crash at startup inside
LyricsApplet::sizeHint cause m_lyrics was null.
According to Plasma::Applet::init doc paint event could be called before
initialization, so m_lyrics should be created earlier.
Following patch makes crash go away, but I wrote it only to check my theory:
Index: lyrics/LyricsApplet.cpp
===================================================================
--- lyrics/LyricsApplet.cpp     (revision 912719)
+++ lyrics/LyricsApplet.cpp     (working copy)
@@ -250,8 +250,11 @@
 {
     DEBUG_BLOCK
     Q_UNUSED( which );
-    debug() << "returning sizehint height of" <<
m_lyrics->sizeHint().height();
-    return QSizeF( constraint.width(), m_lyrics->sizeHint().height() );
+    if (m_lyrics) {
+        debug() << "returning sizehint height of" <<
m_lyrics->sizeHint().height();
+        return QSizeF( constraint.width(), m_lyrics->sizeHint().height() );
+    }
+    return QSizeF();

 }
 void
Sorry, I'd had to revert my fix to provide backtrace, so I'm gonna omit it
for now

Best regards,
Vyacheslav Tokarev (vtokarev)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/amarok/attachments/20090118/6f25efdb/attachment.html>


More information about the Amarok mailing list