Bug report #13973

Crash when switching from custom renderer to another

Added by Alexander Bruy almost 9 years ago. Updated over 8 years ago.

Status:Closed
Priority:High
Assignee:Martin Dobias
Category:Python plugins
Affected QGIS version:master Regression?:No
Operating System:all Easy fix?:No
Pull Request or Patch supplied:No Resolution:invalid
Crashes QGIS or corrupts data:Yes Copied to github as #:21987

Description

Subject says it all. To reproduce:

  1. add custom renderer for vector layer (e.g. one from VectorFieldRenderer plugin or from attached example plugin)
  2. load point layer and select custom renderer for it from layer properties dialog
  3. apply changes and close layer properties dialog
  4. open layer properties dialog again and try to select standard renderer, e.g. Single Symbol
  5. QGIS crashes

renderertest.tar.bz2 (4.12 KB) Alexander Bruy, 2015-12-22 06:21 AM


Related issues

Related to QGIS Application - Bug report #14025: Crash when loading project with custom renderer for vecto... Closed 2015-12-22

Associated revisions

Revision 492c1a9f
Added by Martin Dobias over 8 years ago

Improve documentation for renderer registry metadata (refs #13973)

History

#1 Updated by Alexander Bruy almost 9 years ago

Ok, I solved issue with crash when switching from custom renderer to standard. But there stll get Python error when switching

TypeError: invalid result type from MyTestRendererWidget.renderer()

I checked, MyTestRendererWidget.renderer() returns subclass of the QgsFeatureRendererV2, as required by API.

Test plugin updated

#2 Updated by Alexander Bruy almost 9 years ago

  • File deleted (renderertest.tar.bz2)

#3 Updated by Alexander Bruy over 8 years ago

  • Assignee set to Martin Dobias

#4 Updated by Martin Dobias over 8 years ago

  • Resolution set to invalid
  • Status changed from Open to Closed

The main problem was that the old renderer was used as-is in the test renderer implementation, while it is just a temporary pointer. See the fixed implementation I have attached in #14025 (mytestrenderer.py).

Improved the documentation and closing as invalid...

Also available in: Atom PDF