Commit f810f246 authored by Guillaume Seguin's avatar Guillaume Seguin

Fix potential RuntimeError in gviz

self.layers dictionnary could change from another thread, thus changing
size during repaint iteration. Using a fixed range with the current
number of layers avoids iterating directly on the dictionnary.
parent 7bec4999
...@@ -338,7 +338,7 @@ class Gviz(wx.Panel): ...@@ -338,7 +338,7 @@ class Gviz(wx.Panel):
dc.DrawRectangle(width - 14, (1.0 - (1.0 * (self.layerindex + 1)) / len(self.layers)) * height, 13, height - 1) dc.DrawRectangle(width - 14, (1.0 - (1.0 * (self.layerindex + 1)) / len(self.layers)) * height, 13, height - 1)
if self.showall: if self.showall:
for i, _ in enumerate(self.layers): for i in range(len(self.layersz)):
self._drawlines(dc, self.lines[i], self.pens[i]) self._drawlines(dc, self.lines[i], self.pens[i])
self._drawarcs(dc, self.arcs[i], self.arcpens[i]) self._drawarcs(dc, self.arcs[i], self.arcpens[i])
return return
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment