From e485c209b170563cebcb41e6187f31501416056d Mon Sep 17 00:00:00 2001 From: fros4943 Date: Fri, 27 Feb 2009 14:48:15 +0000 Subject: [PATCH] bugfix: clear all mote relations when simulation is removed --- tools/cooja/java/se/sics/cooja/GUI.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/tools/cooja/java/se/sics/cooja/GUI.java b/tools/cooja/java/se/sics/cooja/GUI.java index 025dd9a5a..f351e22da 100644 --- a/tools/cooja/java/se/sics/cooja/GUI.java +++ b/tools/cooja/java/se/sics/cooja/GUI.java @@ -24,7 +24,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - * $Id: GUI.java,v 1.109 2009/02/26 13:35:45 fros4943 Exp $ + * $Id: GUI.java,v 1.110 2009/02/27 14:48:15 fros4943 Exp $ */ package se.sics.cooja; @@ -2302,6 +2302,13 @@ public class GUI extends Observable { // Delete simulation mySimulation.deleteObservers(); mySimulation.stopSimulation(); + + /* Clear current mote relations */ + MoteRelation relations[] = getMoteRelations(); + for (MoteRelation r: relations) { + removeMoteRelation(r.source, r.dest); + } + mySimulation = null; // Unregister temporary plugin classes