# HG changeset patch # User cheesesucker@33b003aa-7bff-0310-803a-e67f0ece8222 # Date 1264718840 0 # Node ID ac7806c46b94b2e3a86fbde8f86c03bb330bcb9d # Parent ef0c7a0cacab45fa9398a84db35f001a0c679da2 * Fixed a crash when opening two maps and closing them * Fixed a bug where closing the first map would destroy all cameras diff -r ef0c7a0cacab -r ac7806c46b94 tools/editor/scripts/editor.py --- a/tools/editor/scripts/editor.py Thu Jan 28 21:50:12 2010 +0000 +++ b/tools/editor/scripts/editor.py Thu Jan 28 22:47:20 2010 +0000 @@ -176,6 +176,8 @@ self._initActions() self._toolbox.show() + + events.preMapClosed.connect(self._mapRemoved) def _initActions(self): """ Initializes toolbar and menubar buttons """ @@ -344,14 +346,11 @@ self.showMapView(mapview) - events.preMapClosed.connect(self._mapRemoved) events.mapAdded.send(sender=self, map=map) return mapview def _mapRemoved(self, mapview): - events.preMapClosed.disconnect(self._mapRemoved) - index = self._mapviewlist.index(mapview)-1 self._mapviewlist.remove(mapview) @@ -362,7 +361,9 @@ break # Change mapview - if index >= 0: + if len(self._mapviewlist) > 0: + if index < 0: + index = 0 self.showMapView(self._mapviewlist[index]) else: self._mapview = None diff -r ef0c7a0cacab -r ac7806c46b94 tools/editor/scripts/mapview.py --- a/tools/editor/scripts/mapview.py Thu Jan 28 21:50:12 2010 +0000 +++ b/tools/editor/scripts/mapview.py Thu Jan 28 22:47:20 2010 +0000 @@ -149,7 +149,7 @@ for cam in view.getCameras(): if cam.getLocationRef().getMap().getId() == self._map.getId(): cam.setEnabled(False) - #view.removeCamera(cam) + view.removeCamera(cam) view.resetRenderers() # Unload the map from FIFE