<html>
<body>
Like in the subject I solved a part of my problem.<br><br>
The correct code to remove the layer from QGis is:<br>
<font face="Courier New, Courier">&nbsp;&nbsp;&nbsp;&nbsp; currentLayer =
<i>self</i>.iface.activeLayer()<br>
&nbsp;&nbsp;&nbsp;&nbsp; RegIns = QgsMapLayerRegistry.instance()<br>
&nbsp;&nbsp;&nbsp;&nbsp;
RegIns.removeMapLayer(currentLayer.getLayerID())<br><br>
</font>but it working if i use it in Python Console, while QGis crash if
I use it in my plugin code<br><br>
<br><br>
<br>
Dear All,<br><br>
i have a problem with QgsMapLayerRegistry class when i try to remove a
Layer from QGis.<br><br>
i use this two code line:<br>
<font face="Courier New, Courier">&nbsp;&nbsp;&nbsp;&nbsp; RegIns =
QgsMapLayerRegistry.instance()<br>
&nbsp;&nbsp;&nbsp;&nbsp; RegIns.removeMapLayer(layerName)<br><br>
</font>where layerName is set with this command line:
<font face="Courier New, Courier">layerName =
<i>self</i>.iface.activeLayer().name()<br><br>
</font>Do someone know how to solve it?<br><br>
Thank you Michele.<br>
</body>
</html>