<div dir="ltr">Hi All,<div><br></div><div style="">there seems to be an issue connecting the SIGNAL layersRemoved from QgsMapLayerRegistry.</div><div style=""><br></div><div style="">For example, if I save this script to a file, and run it from the Linux terminal:</div><div style=""><br></div><div style="">################################################</div><div style=""><div>import unittest</div><div>from qgis.core import QgsApplication, QgsMapLayerRegistry</div><div><br></div><div>class SIGNALTest( unittest.TestCase ):</div><div><br></div><div>    def setUp( self ):</div><div>        app = QgsApplication([], True)</div><div>        QgsApplication.setPrefixPath("/usr", True)</div><div>        QgsApplication.initQgis()</div><div>        </div><div>        QgsMapLayerRegistry.instance().layersRemoved.connect( self.myFunction )             </div><div>        </div><div>    def myFunction( self, layerIds ):</div><div>        print "Called!"</div><div>        </div><div>    def test1( self ):</div><div>        self.assertEqual(1,1)</div><div><br></div><div>    def tearDown( self ):   </div><div>        QgsApplication.exitQgis()    </div><div>               </div><div>if __name__ == "__main__":</div><div>    unittest.main()</div></div><div style="">################################################</div><div style=""><br></div><div style="">I get the following result:</div><div style=""><br></div><div style="">##########</div><div style=""><div>Called!</div><div>.</div><div>----------------------------------------------------------------------</div><div>Ran 1 test in 0.119s</div><div><br></div><div>OK</div><div>Segmentation fault</div><div>###########</div></div><div style=""><br></div><div style="">If, on the contrary, I comment out the line where the connection is set or if I use other signals such as layerRemoved or layersAdded instead of layersRemoved, I get:</div><div style=""><br></div><div style="">###########<br></div><div style=""><div>.</div><div>----------------------------------------------------------------------</div><div>Ran 1 test in 0.111s</div><div><br></div><div>OK</div></div><div style="">###########<br></div><div style=""><br></div><div style="">I'm using QGIS 2.14.2 on a GNU/Linux machine.</div><div style=""><br></div><div style="">Can you confirm such problem? Do you have any clue about it?</div><div><br></div><div><br></div><div>Regards, </div><div><br></div><div>Germán</div><div><br><div>-- <br><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div dir="ltr"><div>-----------<br></div><div>   |\__  <br>(:>__)(<br>   |/    <br>Soluciones Geoinformáticas Libres                            <br><a href="http://geotux.tuxfamily.org/" target="_blank">http://geotux.tuxfamily.org/</a><br><a href="http://twitter.com/GeoTux2" target="_blank">http://twitter.com/GeoTux2</a></div><div><a href="http://about.me/germancarrillo" target="_blank">http://about.me/germancarrillo</a><br></div><div><div><br></div><div><a href="http://gis.stackexchange.com/users/4972/germ%c3%a1n-carrillo" target="_blank"><img src="http://gis.stackexchange.com/users/flair/4972.png"></a></div></div></div></div></div></div></div>
</div></div></div>