[Qgis-developer] PyQgis crashes when using QgsComposition for printing

Martin Dobias wonder.sk at gmail.com
Sun May 30 11:58:23 EDT 2010


Hi Marcelo


On Wed, May 19, 2010 at 9:06 AM, Marcelo Reyes <reyesmarcelo at gmail.com> wrote:
> Hello,
>
> I'm developping a PyQgis Stand Alone App using Windows XP and Qgis
> Enceladus. I was trying to add a function that prints the map to a pdf file.
> I found this code:
>
> [...]
>
> The line that causes the crash is: c.addItem(composerMap)
> I tried to look for addItem in the QgsComposition functions list (in Qgis
> API) but could not find it.

I've found the source of the problem and fixed it in r13602. For an
instant workaround, once the rendering is done, explicitly delete the
composerMap:

c.removeItem(composerMap)
del composerMap

That should the segfault.

Martin


More information about the Qgis-developer mailing list