segementation fault in KDevelop

Micko Roland Roland.Micko at icn.siemens.de
Mon Sep 6 12:36:21 BST 1999


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 mailing list