Bug report #7250
Crash when layers loaded using a python plugin and diagramRenderer
|Affected QGIS version:||master||Regression?:||No|
|Operating System:||Linux||Easy fix?:||No|
|Pull Request or Patch supplied:||No||Resolution:|
|Crashes QGIS or corrupts data:||Yes||Copied to github as #:||16273|
I am writing a plugin that loads three layers from a set of text files. It loads them using code from the cookbook, as amended to match the new API for the QgsFeature and QgsVectorFileWriter. If the files exist, I can load them as old files, and the problem persists...
The code worked reliably until about three weeks ago (using the old API) and runs fine in QGis 1.8 (using the old API), although the python bindings for the diagramRenderer are not present, so it skips it.
One element of the code tries to create a diagramRenderer. This used to work fine, creating the pie charts. I used the code from the diagrams tab in C++ as a template for the calls.
If I comment out the diagramRenderer code, QGIS works normally. If I uncomment it, the diagram does not appear, but I can click the interface and widgets respond. Once I click a few things, or call up the context menu for the layer with the diagramRenderer applied, QGIS crashes.
At the very least, this shouldn't crash QGIS. I'm perfectly happy to have my code fail, but not crash the program...
#3 Updated by Matthias Kuhn over 6 years ago
- Status changed from In Progress to Feedback
I executed the attached code in the python console on latest master.
The diagrams show up and I could not provoke a crash.
I can open the context menu of the TOC and clicking the items in the diagram tab works as well.
Can you give more information on how to reproduce?
Nevertheless, I can reproduce a crash by running the snippet twice. But that's not the scenario you've encountered?