[Marble-commits] KDE/kdeedu/marble/src/lib/runners

Thibaut Gridel tgridel at free.fr
Sun Jul 18 00:21:58 CEST 2010


SVN commit 1151118 by tgridel:

OnfRunner: feed a new vector with copies of placemarks

This is because the original placemarks get deleted along with the
GeoDatadocument which got parsed

 M  +6 -2      OnfRunner.cpp  


--- trunk/KDE/kdeedu/marble/src/lib/runners/OnfRunner.cpp #1151117:1151118
@@ -107,15 +107,19 @@
     
     GeoDataDocument *results = static_cast<GeoDataDocument*>( parser.releaseDocument() );
     Q_ASSERT( results );
-
     QVector<GeoDataPlacemark*> placemarks = results->placemarkList();
 
+    // feed a new vector, because docPlacemarks and its placemarks will get
+    // deleted along with results
+    QVector<GeoDataPlacemark*> returnPlacemarks;
+
     QVector<GeoDataPlacemark*>::iterator it = placemarks.begin();
     QVector<GeoDataPlacemark*>::iterator end = placemarks.end();
     for(; it != end; ++it ) {
         (*it)->setVisualCategory( category() );
+        returnPlacemarks.append( new GeoDataPlacemark( **it ) );
     }
-    emit runnerFinished( this, placemarks );
+    emit runnerFinished( this, returnPlacemarks );
     delete results;
     return;
 }


More information about the Marble-commits mailing list