Well, I thought this order would do those things:<br><br> self.layers.remove( i )
<br> QgsMapLayerRegistry.instance().removeMapLayer( i.layer().getLayerID() )
<br><div id=":ve" class="ii gt"> self.canvas.setLayerSet( self.layers )
</div><br>Anyway, I did the two lines swap and get the segmentation fault again.<br><br>Germán <br><br><div class="gmail_quote">El 16 de junio de 2009 10:04, Martin Dobias <span dir="ltr"><<a href="http://wonder.sk">wonder.sk</a>@<a href="http://gmail.com">gmail.com</a>></span> escribió:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div class="im">2009/6/16 Germán Carrillo <<a href="mailto:carrillo.german@gmail.com">carrillo.german@gmail.com</a>>:<br>
</div><div class="im">> Thanks Martin, but I remove the layer from the layerSet before removing from<br>
> QgsMapLayerRegistry. So, when I update the layer set in canvas, the layer<br>
> doesn't exists.<br>
<br>
</div>From your code I see you only remove the layer from the self.layers<br>
dictionary. But canvas (resp. map renderer class) still thinks that<br>
the layer exists.<br>
<font color="#888888"><br>
Martin<br>
</font></blockquote></div><br><br clear="all"><br>-- <br>-----------<br> |\__ <br>(:>__)(<br> |/ <br><br>Soluciones Geoinformáticas Libres <br><a href="http://geotux.tuxfamily.org/">http://geotux.tuxfamily.org/</a><br>
<br>