[QGIS-trac] [Quantum GIS] #3366:
QgsVectorLayer.committedFeaturesRemoved causes crash in Python
Quantum GIS
qgis at qgis.org
Wed Dec 22 16:18:31 EST 2010
#3366: QgsVectorLayer.committedFeaturesRemoved causes crash in Python
---------------------------------------------------------+------------------
Reporter: ccrook | Owner: borysiasty
Type: bug | Status: new
Priority: critical: causes crash or data corruption | Milestone: Version 1.7.0
Component: Python plugins and bindings | Version: 1.6.0
Keywords: | Platform_version: XP SP3
Platform: Windows | Must_fix: No
Status_info: 0 |
---------------------------------------------------------+------------------
To replicate the problem ..
1) Open a new QGis project
2) Open a python console window
3) Enter the following code
{{{
from PyQt4.QtCore import *
def handler():
print "Deleting features"
# Create a scratch layer and connect to committedFeaturesRemoved signal
type="Point"
name = "Test"
layer = QgsVectorLayer(type, name, "memory")
QgsMapLayerRegistry.instance().addMapLayer(layer)
qgis.utils.iface.mapCanvas().setCurrentLayer(layer)
QObject.connect(layer, SIGNAL("committedFeaturesRemoved(const QString &,
const QgsFeatureIds & )"),handler)
}}}
This will create a layer called test
4) Set the layer to be editable
5) Add a point to the layer
6) Commit the change (save the layer)
7) Select the point
8) Delete the point
9) Commit the change - this causes the crash.
This happens consistently for me in QGis versions 1.6 and 1.7 r14962
Operating system is windows XP SP3
I've had a look at it as far as I can in the Visual Studio debugger. The
crash appears to happen in the generated moc_.. file where the python
signal is implemented, and the message is:
Unhandled exception at 0x0372ba7c in qgis.exe: 0xC000001E: An attempt
was made to execute an invalid lock sequence.
--
Ticket URL: <http://trac.osgeo.org/qgis/ticket/3366>
Quantum GIS <http://qgis.org>
Quantum GIS is an Open Source GIS viewer/editor supporting OGR, PostGIS, and GRASS formats
More information about the QGIS-trac
mailing list