From 8f52e27fe15a53dfb0cdc0b1f9eb46ccfbaba629 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Adrien=20B=C3=A9raud?= <adrien.beraud@savoirfairelinux.com>
Date: Wed, 30 Sep 2015 23:04:38 -0400
Subject: [PATCH] scanner: clear nodeset on restart

---
 python/tools/scanner.py | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/python/tools/scanner.py b/python/tools/scanner.py
index d58d9e44..2864741c 100755
--- a/python/tools/scanner.py
+++ b/python/tools/scanner.py
@@ -114,10 +114,10 @@ def step(cur_h, cur_depth):
 
 def nextstep(cur_h, cur_depth, ok, nodes, arc=None, lines=[]):
     global done, all_nodes
+    if arc:
+        arc.remove()
+        del arc
     if nodes:
-        if arc:
-            arc.remove()
-            del arc
         for l in lines:
             l.set_color('#444444')
         snodes = NodeSet()
@@ -140,11 +140,14 @@ def exitcb(arg):
 exitbtn.on_clicked(exitcb)
 
 def restart(arg):
-    global collection, all_lines, points
+    global collection, all_lines, all_nodes, points, done
+    if done:
+        return
     for l in all_lines:
         l.remove()
         del l
     all_lines = []
+    all_nodes = NodeSet()
     if collection:
         collection.remove()
         del collection
-- 
GitLab