Fixed error when stopping PLC with wxglade HMI
authorEdouard Tisserant
Wed, 24 Apr 2013 18:34:00 +0900
changeset 1053 b0ac30ba7eaf
parent 1052 fa7c5034c1d2
child 1062 fd7c9a7cf882
Fixed error when stopping PLC with wxglade HMI
wxglade_hmi/wxglade_hmi.py
--- a/wxglade_hmi/wxglade_hmi.py	Wed Apr 24 17:21:20 2013 +0900
+++ b/wxglade_hmi/wxglade_hmi.py	Wed Apr 24 18:34:00 2013 +0900
@@ -95,7 +95,7 @@
     %(name)s.Show()
 """ % {"name": x[0], "class": x[1]},
                              hmi_frames.items())),
-       "cleanup": "\n    ".join(map(lambda x:"%s.Destroy()" % x, hmi_frames.keys()))})
+       "cleanup": "\n    ".join(map(lambda x:"if %s is not None: %s.Destroy()" % (x,x), hmi_frames.keys()))})
         runtimefile.close()
         
         return [], "", False, ("runtime_%s.py"%location_str, file(runtimefile_path,"rb"))