Bug 318736

Summary: GeoScene not cleared properly, leads to crash
Product: [Applications] marble Reporter: Dennis Nienhüser <nienhueser>
Component: generalAssignee: Thibaut Gridel <tgridel>
Status: RESOLVED DUPLICATE    
Severity: normal CC: shentey, tgridel
Priority: NOR    
Version: 1.6 (KDE 4.11)   
Target Milestone: ---   
Platform: Other   
OS: Linux   
URL: https://forum.kde.org/viewtopic.php?f=217&t=109874&p=263576#p263576
Latest Commit: Version Fixed In:
Sentry Crash Report:

Description Dennis Nienhüser 2013-04-22 19:49:32 UTC
Quoting the forum thread:

1) If you enable FileViewWidget, you may want to enable/disable or open/close user-opened documents (shapefiles, kml or others). Usually, everything's fine when you open or enable document (or separate objects in it). But when you try to disable document, you may see that not all document's objects gone from map. Furthermore, if you try to close that document, application will crash when rendering GeometryLayer.
All this is because, when document deleted from TreeModel or erased at all from memory, not all of its objects deleted from GeoGraphicsScene. Root of the problem is in function GeoGraphicsScene::removeItem (file GeoGraphicsScene.cpp) - not all pointers to document's object are deleted from graphics scene.
Code: Select all
void GeoGraphicsScene::removeItem( const GeoDataFeature* feature )
{
///-    const TileId key = d->m_features.value( feature );
///-    QList< GeoGraphicsItem* >& tileList = d->m_items[key];
///-    foreach( GeoGraphicsItem* item, tileList ) {
///-        if( item->feature() == feature ) {
///-            d->m_features.remove( feature );
///-            tileList.removeAll( item );
///-            return;
///-        }
///-    }
    foreach( TileId key, d->m_items.keys() ) {                              ///+
        QList< GeoGraphicsItem* >& tileList = d->m_items[key];              ///+
        foreach( GeoGraphicsItem* item, tileList ) {                        ///+
            if( item->feature() == feature )                                ///+
                tileList.removeAll( item );                                 ///+
        }                                                                   ///+
    }                                                                       ///+
    d->m_features.remove( feature );                                        ///+
}
Comment 1 Dennis Nienhüser 2013-04-22 20:41:52 UTC
This might have been introduced in bb92970f93b4463b30dff9a8bdb7f49ccd63fc9b

I see the problem when opening Overlay.kml from examples/kml/ and closing it. The overlays are still rendered afterwards.
Comment 2 Bernhard Beschow 2013-04-22 22:11:18 UTC
Might be a duplicate of bug 318512.
Comment 3 Thibaut Gridel 2013-04-23 21:32:55 UTC

*** This bug has been marked as a duplicate of bug 318512 ***