> > On Mon, Feb 7, 2011 at 12:40 PM, Federico J. Fernández > <[email protected]> wrote: > > QgsFeatureList &featureList = this->currentLayer->selectedFeatures(); > > You only store reference to a temporary list returned by > selectedFeatures(). That list is destroyed when that function > terminates, so you have an invalid reference. Store the whole list > instead, not just that reference: > > QgsFeatureList featureList = .... ; > > Your original post actually listed the correct version (without the > reference '&'), that's why it wasn't clear where's your problem. > > By the way, QGIS contains a map tool for merging features (in > src/app), so you could save your work by using that code instead of > writing similar code again. > > Sorry for the mistake Martin, it gives an exception with and without the &.
I know about the QGIS tool, my version is copied from that code, but without some layer checks that are not neede in my application. Thanks again for your help! -- fede
_______________________________________________ Qgis-developer mailing list [email protected] http://lists.osgeo.org/mailman/listinfo/qgis-developer
