[QGIS-Developer] Drag and drop to PostGIS crash

Radim Blazek radim.blazek at gmail.com
Mon Jun 19 23:35:23 PDT 2017


On Fri, Jun 2, 2017 at 11:02 AM, Radim Blazek <radim.blazek at gmail.com> wrote:
> On Fri, Jun 2, 2017 at 10:48 AM, Nyall Dawson <nyall.dawson at gmail.com> wrote:
>> QgsBrowserItem::handleDrop just gets a layer URI in the mime data -
>> that's enough for the other providers to be able to open a new copy of
>> the layer to grab the features from, but the for the memory provider
>> the uri only gives the table structure.... there's no features in the
>> newly created layer.
>
> It should be possible to pass the layer id and open an iterator on it?

I have implemented DD for memory layer using layer id passed in mime
data, but it is crashing in
QgsVectorLayerExporter::exportLayer()
on
QgsFeatureIterator fit = layer->getFeatures( req );

#0  0x0000000003abf980 in ?? ()
#1  0x00007fd5bd913d7d in QgsVectorLayerExporter::exportLayer
(layer=0x37f78a0, uri=..., providerKey=..., destCRS=...,
    onlySelected=false, errorMessage=0x34a5d68, options=0x34a5d50,
feedback=0x34a7f00)
    at /home/radim/devel/qgis/src/core/qgsvectorlayerexporter.cpp:332
#2  0x00007fd5bd9155e1 in QgsVectorLayerExporterTask::run (this=0x34a5cd0)
    at /home/radim/devel/qgis/src/core/qgsvectorlayerexporter.cpp:493
#3  0x00007fd5bd82e08d in QgsTask::start (this=0x34a5cd0) at
/home/radim/devel/qgis/src/core/qgstaskmanager.cpp:66
#4  0x00007fd5bd83a92c in QgsTaskRunnableWrapper::run (this=0x3793c00)
at /home/radim/devel/qgis/src/core/qgstaskmanager.cpp:335

Could it be a problem that feature iterator on memory layer is opened
from QgsVectorLayerExporterTask? Renderer also reads memory layer
features in thread.

Radim


More information about the QGIS-Developer mailing list