Bug#45265: closing terminal emulation crashes konqueror

Waldo Bastian bastian at kde.org
Wed Jul 17 07:41:53 BST 2002


On Tuesday 16 July 2002 05:34 pm, David Faure wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Ah cool. Longstanding problem (very very long), but now we have valgrind,
> it does help tremendously ;)
>
> > ==5476==    by 0x4037CCEC: KParts::Part::~Part(void) (part.cpp:155)
> > ==5476==    by 0x4037D260: KParts::Part::slotWidgetDestroyed(void)
> > (part.cpp:260)
>
> No time for testing myself (time for bed!), but... does this help?

It helps, it crashes later now :-\

I also need:

@@ -342,7 +342,10 @@ void PartManager::removePart( Part *part
   emit partRemoved( part );

   if ( part == d->m_activePart )
+  {
+    d->m_activePart = 0;
     setActivePart( 0 );
+  }

Not sure if that is the right fix. Problem is that setActivePart(foo) crashes 
when the old d->m_activePart has been deleted already. Resetting it to 0 
first solves that problem, but I wonder if it is still needed to call 
setActivePart at all then.

With that patch it starts crashing in konsole code so we are definitly moving 
in the right direction :-)

Cheers,
Waldo

> Index: part.cpp
> ===================================================================
> RCS file: /home/kde/kdelibs/kparts/part.cpp,v
> retrieving revision 1.118
> diff -u -p -r1.118 part.cpp
> - --- part.cpp    2002/06/15 15:05:09     1.118
> +++ part.cpp    2002/07/17 00:33:17
> @@ -139,14 +139,18 @@ Part::Part( QObject *parent, const char*
>  Part::~Part()
>  {
>    kdDebug(1000) << "Part::~Part " << this << endl;
> - -  if ( m_manager )
> - -    m_manager->removePart(this);
> - -
>    if ( m_widget )
>    {
>      // We need to disconnect first, to avoid calling it !
>      disconnect( m_widget, SIGNAL( destroyed() ),
>                  this, SLOT( slotWidgetDestroyed() ) );
> +  }
> +
> +  if ( m_manager )
> +    m_manager->removePart(this);
> +
> +  if ( m_widget )
> +  {
>      kdDebug(1000) << "deleting widget " << m_widget << " " <<
> m_widget->name() << endl; delete (QWidget*) m_widget;
>    }
>
> (stupid diff. I'm not moving removePart down, I'm moving the disconnect up.
> Ok, it's the same thing ;-)
>
> - --
> David FAURE, david at mandrakesoft.com, faure at kde.org
> http://people.mandrakesoft.com/~david/
> Contributing to: http://www.konqueror.org/, http://www.koffice.org/
> KOffice-1.2-beta2 is out! http://dot.kde.org/1025176121/
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.0.6 (GNU/Linux)
> Comment: For info see http://www.gnupg.org
>
> iD8DBQE9NLt+72KcVAmwbhARAtahAJ99qj7WcLRYIjHEKjPb9uhEbL4ndQCdGHDk
> uQCIfmTPeNu2Z+9f5AbO/Dk=
> =Gvfo
> -----END PGP SIGNATURE-----

-- 
bastian at kde.org  |   SuSE Labs KDE Developer  |  bastian at suse.com





More information about the kfm-devel mailing list