[Qgis-developer] PyQGIS: QGIS segfaults when using Qgsvectorlayer.select() inside signal handler

Rafael Varela Pet rafael.varela at gmail.com
Fri Oct 19 09:27:27 PDT 2012


Hi,

Looking at the source code in the git repository I found out that most
of the Qgsvectorlayer::select() functionality resides in the data
provider, so I decided to write the layers to disk and switch the
layer data provider from "memory" to "ogr".

The problem still persists, so I decided to file a bug report (#6547).

2012/10/13, Rafael Varela Pet <rafael.varela at gmail.com>:

> Hi again,
>
> I forgot to mention that QGIS only segfaults when using the node tool
> of mDigitizeToolBar.
>
> It does not crash when I use the move feature tool.
>
>
> 2012/10/13 Rafael Varela Pet <rafael.varela at gmail.com>:
>
>> I'm developing a python plugin in QGIS 1.9.0-master that makes QGIS
>> segfault when I call Qgsvectorlayer.select() inside a geometryChanged
>> signal handler
>>
>> My code looks like this:
>>
>> ...
>>
>> layer_A.geometryChanged.connect(self.onLineGeometryChange)
>>
>> ...
>>
>> @pyqtSlot(int, QgsGeometry)
>> def onLineGeometryChange(self, featureId, geom ):
>>   ...
>>   layer_B.select( someRectangle, False )
>>   ---
>>
>>
>> Is it illegal to call "select()" inside "onLineGeometryChange()"?
>>
>> By the way, I'm not really interested in selecting features. I only
>> wanted to find the existing features inside a map area, but I didn't
>> find any other way but using "select()"


Regards,
-- 
Rafael Varela


More information about the Qgis-developer mailing list