소스 검색

wxGUI: avoid flush clipboard if not opened (#819)

Fixes #786
nilason 4 년 전
부모
커밋
70a03587be
2개의 변경된 파일4개의 추가작업 그리고 2개의 파일을 삭제
  1. 2 1
      gui/wxpython/gui_core/goutput.py
  2. 2 1
      gui/wxpython/gui_core/prompt.py

+ 2 - 1
gui/wxpython/gui_core/goutput.py

@@ -676,7 +676,8 @@ class GStc(stc.StyledTextCtrl):
         """The clipboard contents can be preserved after
         the app has exited"""
 
-        wx.TheClipboard.Flush()
+        if wx.TheClipboard.IsOpened():
+            wx.TheClipboard.Flush()
         evt.Skip()
 
     def AddTextWrapped(self, txt, wrap=None):

+ 2 - 1
gui/wxpython/gui_core/prompt.py

@@ -621,7 +621,8 @@ class GPromptSTC(GPrompt, wx.stc.StyledTextCtrl):
     def OnDestroy(self, event):
         """The clipboard contents can be preserved after
         the app has exited"""
-        wx.TheClipboard.Flush()
+        if wx.TheClipboard.IsOpened():
+            wx.TheClipboard.Flush()
         event.Skip()
 
     def OnCmdErase(self, event):