1 diff --git a/src/src/app.cpp b/src/src/app.cpp
2 index 81130fd..f98d37b 100644
5 @@ -602,7 +602,8 @@ bool CodeBlocksApp::OnInit()
6 m_BatchWindowAutoClose = true;
7 m_pSingleInstance = nullptr;
9 - wxTheClipboard->Flush();
10 + if (wxTheClipboard->IsOpened())
11 + wxTheClipboard->Flush();
13 wxCmdLineParser& parser = *Manager::GetCmdLineParser();
14 parser.SetDesc(cmdLineDesc);
15 @@ -851,7 +852,8 @@ bool CodeBlocksApp::OnInit()
17 int CodeBlocksApp::OnExit()
19 - wxTheClipboard->Flush();
20 + if (wxTheClipboard->IsOpened())
21 + wxTheClipboard->Flush();
23 if (g_DDEServer) delete g_DDEServer;