Bug 130495

Summary: Crash on exit in ~KHTMLPart
Product: [Applications] amarok Reporter: Ilya Konstantinov <kde-bug-report>
Component: generalAssignee: Amarok Developers <amarok-bugs-dist>
Status: RESOLVED FIXED    
Severity: crash    
Priority: NOR    
Version: 1.4.1   
Target Milestone: ---   
Platform: Compiled Sources   
OS: Linux   
Latest Commit: Version Fixed In:
Attachments: Patch to work around the issue

Description Ilya Konstantinov 2006-07-09 03:16:13 UTC
Version:           1.4.1 (using KDE KDE 3.5.3)
Installed from:    Compiled From Sources

Due to the KHTMLPart deficiency described in bug 130494, Amarok crashes on exit within the ~KHTMLPart dtor.

This can be worked around by deleting all our KHTMLParts before the widget hierarchy is destroyed.
Comment 1 Ilya Konstantinov 2006-07-09 03:16:57 UTC
Created attachment 16927 [details]
Patch to work around the issue
Comment 2 Alexandre Oliveira 2006-07-09 15:48:42 UTC
SVN commit 560186 by aoliveira:

KHTMLPart dtor relies on its KHTMLView still being alive, and crashes otherwise, so let's workaround this.
Patch by Ilya Konstantinov <kde-bug-report (at) future shiny co il>
BUG: 130495


 M  +6 -0      contextbrowser.cpp  
 M  +8 -0      playlistbrowser.cpp  
 M  +1 -0      playlistbrowser.h  


--- trunk/extragear/multimedia/amarok/src/contextbrowser.cpp #560185:560186
@@ -319,6 +319,12 @@
 
 ContextBrowser::~ContextBrowser()
 {
+    // Ensure the KHTMLPart dies before its KHTMLView dies,
+    // because KHTMLPart's dtoring relies on its KHTMLView still being alive
+    // (see bug 130494).
+    delete m_currentTrackPage;
+    delete m_lyricsPage;
+    delete m_wikiPage;
     m_cuefile->clear();
 }
 
--- trunk/extragear/multimedia/amarok/src/playlistbrowser.cpp #560185:560186
@@ -3456,6 +3456,14 @@
     setFixedHeight( m_pushButton->sizeHint().height() );
 }
 
+InfoPane::~InfoPane()
+{
+    // Ensure the KHTMLPart dies before its KHTMLView dies,
+    // because KHTMLPart's dtoring relies on its KHTMLView still being alive
+    // (see bug 130494).
+    delete m_infoBrowser;
+}
+
 const int
 InfoPane::getHeight()
 {
--- trunk/extragear/multimedia/amarok/src/playlistbrowser.h #560185:560186
@@ -367,6 +367,7 @@
 
 public:
     InfoPane( QWidget *parent );
+    ~InfoPane();
     const int getHeight();
     void setStoredHeight( const int newHeight );