Skip to content

Commit

Permalink
wxGUI: avoid flush clipboard if not opened (#819)
Browse files Browse the repository at this point in the history
Fixes #786
  • Loading branch information
nilason authored and petrasovaa committed Jul 22, 2020
1 parent 0606f57 commit 70a0358
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion gui/wxpython/gui_core/goutput.py
Expand Up @@ -676,7 +676,8 @@ def OnDestroy(self, evt):
"""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):
Expand Down
3 changes: 2 additions & 1 deletion gui/wxpython/gui_core/prompt.py
Expand Up @@ -621,7 +621,8 @@ def GetTextLeft(self):
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):
Expand Down

0 comments on commit 70a0358

Please sign in to comment.