Fix bug with Clipboard that generated segmentation fault when closing dialogs
authorLaurent Bessard
Sat, 25 Aug 2012 14:44:49 +0200
changeset 745 ecd2effd4660
parent 744 bebdef08f684
child 746 963123fb4917
Fix bug with Clipboard that generated segmentation fault when closing dialogs
PLCOpenEditor.py
Viewer.py
--- a/PLCOpenEditor.py	Tue Aug 21 18:41:17 2012 +0200
+++ b/PLCOpenEditor.py	Sat Aug 25 14:44:49 2012 +0200
@@ -1096,21 +1096,19 @@
 
     def GetCopyBuffer(self):
         data = None
-        if wx.TheClipboard.IsOpened() or wx.TheClipboard.Open():
+        if wx.TheClipboard.Open():
             dataobj = wx.TextDataObject()
             if wx.TheClipboard.GetData(dataobj):
                 data = dataobj.GetText()
-        if wx.TheClipboard.IsOpened():
             wx.TheClipboard.Close()
         return data
         
     def SetCopyBuffer(self, text):
-        if wx.TheClipboard.IsOpened() or wx.TheClipboard.Open():
+        if wx.TheClipboard.Open():
             data = wx.TextDataObject()
             data.SetText(text)
             wx.TheClipboard.SetData(data)
             wx.TheClipboard.Flush()
-        if wx.TheClipboard.IsOpened():
             wx.TheClipboard.Close()
         self.RefreshEditMenu()
 
--- a/Viewer.py	Tue Aug 21 18:41:17 2012 +0200
+++ b/Viewer.py	Sat Aug 25 14:44:49 2012 +0200
@@ -927,7 +927,7 @@
         if self.ParentWindow:
             self.ParentWindow.RefreshTitle()
             self.ParentWindow.RefreshFileMenu()
-            wx.CallAfter(self.ParentWindow.RefreshEditMenu)
+            self.ParentWindow.RefreshEditMenu()
     
     def StartBuffering(self):
         if not self.Buffering: