Bug 318736 - GeoScene not cleared properly, leads to crash
Summary: GeoScene not cleared properly, leads to crash
Status: RESOLVED DUPLICATE of bug 318512
Alias: None
Product: marble
Classification: Applications
Component: general (show other bugs)
Version: 1.6 (KDE 4.11)
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: Thibaut Gridel
URL: https://forum.kde.org/viewtopic.php?f...
Keywords:
Depends on:
Blocks:
 
Reported: 2013-04-22 19:49 UTC by Dennis Nienhüser
Modified: 2013-04-23 21:40 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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 ***