[Qgis-developer] Re: dynamic_cast related to segfaults
Giuseppe Sucameli
brush.tyler at gmail.com
Fri May 28 05:28:45 EDT 2010
Hi all,
without any changes to that code, now QGis doesn't crash more if
I drop a layer in an invalid place.
I don't know if it was due to a bad compilation, but I'm sure
I compiled and recompiled QGis while I was searching for the error.
Cheers.
On Thu, May 27, 2010 at 1:30 PM, Giuseppe Sucameli <brush.tyler at gmail.com>wrote:
> Hi guys,
> while I wrote a patch for QgsLegend, I found an issue related with
> segmentation faults.
>
> Here the bugged code:
>
> QTreeWidgetItem* destItem = mDropTarget;
> ...
> QgsLegendItem* dest = dynamic_cast<QgsLegendItem *>( destItem );
>
> If mDropTarget is NULL QGis crashes with segfault.
> In this case the problem is the dynamic_cast, used without make a null test
> on destItem.
>
> May some other crashes be due to a code like this??
>
> Cheers.
>
> --
> Giuseppe Sucameli
>
--
Giuseppe Sucameli
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/qgis-developer/attachments/20100528/77b771d7/attachment.html
More information about the Qgis-developer
mailing list