Commit a06669fe authored by Kliment Yanev's avatar Kliment Yanev

Destroy file selection dialogs after use - fixes a memory leak as well as a...

Destroy file selection dialogs after use - fixes a memory leak as well as a gtk bug that vim triggers when editing gcode files
parent 253088d4
...@@ -374,6 +374,7 @@ class stlwin(wx.Frame): ...@@ -374,6 +374,7 @@ class stlwin(wx.Frame):
if(dlg.ShowModal() == wx.ID_OK): if(dlg.ShowModal() == wx.ID_OK):
name = dlg.GetPath() name = dlg.GetPath()
self.writefiles(name) self.writefiles(name)
dlg.Destroy()
def writefiles(self, name): def writefiles(self, name):
sf = open(name.replace(".", "_") + ".scad", "w") sf = open(name.replace(".", "_") + ".scad", "w")
...@@ -401,6 +402,7 @@ class stlwin(wx.Frame): ...@@ -401,6 +402,7 @@ class stlwin(wx.Frame):
self.load_stl(event, name) self.load_stl(event, name)
elif (name.lower().endswith(".scad")): elif (name.lower().endswith(".scad")):
self.load_scad(event, name) self.load_scad(event, name)
dlg.Destroy()
def load_scad(self, event, name): def load_scad(self, event, name):
lf = open(name) lf = open(name)
......
...@@ -163,7 +163,7 @@ class setframe(wx.Frame): ...@@ -163,7 +163,7 @@ class setframe(wx.Frame):
print len(layers[0]), "layers found, total height", layers[1]*len(layers[0]), "mm" print len(layers[0]), "layers found, total height", layers[1]*len(layers[0]), "mm"
self.thickness.SetValue(str(layers[1])) self.thickness.SetValue(str(layers[1]))
self.layers=layers self.layers=layers
dlg.Destroy()
def startdisplay(self,event): def startdisplay(self,event):
self.f.Raise() self.f.Raise()
......
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