Fwd: segementation fault in KDevelop

Bernd Gehrmann bernd at physik.hu-berlin.de
Wed Sep 8 19:26:16 UTC 1999


Am I too stupid or what? :-( Where is CClassView::tip()
used at all?

----------  Forwarded message  ----------
Subject: segementation fault in KDevelop
Date: Mon, 6 Sep 1999 13:36:21 +0200
From: Micko Roland <Roland.Micko at icn.siemens.de>


If the mouse pointer is moved in the classview to the section 'Global' and
there on one of the main items like 'Structures' 'Functions..' KDevelop
crashes. The reason therefore is a wrong series in the if statement in
function CClassView::tip

Original source
----------------------------------------------------------------------------
----------
void CClassView::tip( const QPoint &p, QRect &r, QString &str )
{
  QListViewItem *i;

  i = itemAt( p );
  r = itemRect( i );

  if( treeH->itemType( i ) != THFOLDER &&  i != NULL && r.isValid() )
    str = i->text( 0 );
  else
    str = "";
}
----------------------------------------------------------------------------
------------

The check, >>i != NULL<< must be done before all other checkes.

Corrected Source
----------------------------------------------------------------------------
------------
void CClassView::tip( const QPoint &p, QRect &r, QString &str )
{
  QListViewItem *i;

  i = itemAt( p );
  r = itemRect( i );

  if( i != NULL && treeH->itemType( i ) != THFOLDER && r.isValid() )
    str = i->text( 0 );
  else
    str = "";
}
----------------------------------------------------------------------------
------------------

Roland Micko
ICN CA MR EG 2

SIEMENS AG
Hofmannstr. 51
81359 München

Tel.: +4989/722-21632
Fax.: +4989/722-47420
email: roland.micko at icn.siemens.de




More information about the KDevelop-devel mailing list