[Qgis-developer] Re: dynamic_cast related to segfaults

Jürgen E. Fischer jef at norbit.de
Fri May 28 07:09:41 EDT 2010


Hi Guiseppe,

On Fri, 28. May 2010 at 11:28:45 +0200, Giuseppe Sucameli wrote:
>    without any changes to that code, now QGis doesn't crash more if
>    I drop a layer in an invalid place.

I don't think dynamic_cast on null pointers are bad.  But all should be
accompanied with a test for the result.  In qgslegend there are several places
where the result is not checked before dereferencing it.  For instance line
266 and 326 - but not in your quoted code.


Jürgen 

-- 
Jürgen E. Fischer         norBIT GmbH               Tel. +49-4931-918175-20
Dipl.-Inf. (FH)           Rheinstraße 13            Fax. +49-4931-918175-50
Software Engineer         D-26506 Norden               http://www.norbit.de

-- 
norBIT Gesellschaft fuer Unternehmensberatung und Informationssysteme mbH
Rheinstrasse 13, 26506 Norden
GF: Jelto Buurman, HR: Amtsgericht Emden, HRB 5502



More information about the Qgis-developer mailing list