Added logic to clear QClipboard contents at program exit. This will prevent a momentary terminal X11 hang and following error message "QClipboard: Unable to receive an event from the clipboard manager in a reasonable time"
This commit is contained in:
parent
2ce2e5a8a3
commit
e36f53609e
|
@ -103,6 +103,8 @@ consoleWin_t::consoleWin_t(QWidget *parent)
|
|||
|
||||
consoleWin_t::~consoleWin_t(void)
|
||||
{
|
||||
QClipboard *clipboard;
|
||||
|
||||
nes_shm->runEmulator = 0;
|
||||
|
||||
gameTimer->stop();
|
||||
|
@ -132,6 +134,18 @@ consoleWin_t::~consoleWin_t(void)
|
|||
g_config->setOption ("SDL.NetworkIP", "");
|
||||
g_config->save ();
|
||||
|
||||
// Clear Clipboard Contents on Program Exit
|
||||
clipboard = QGuiApplication::clipboard();
|
||||
|
||||
if ( clipboard->ownsClipboard() )
|
||||
{
|
||||
clipboard->clear( QClipboard::Clipboard );
|
||||
}
|
||||
if ( clipboard->ownsSelection() )
|
||||
{
|
||||
clipboard->clear( QClipboard::Selection );
|
||||
}
|
||||
|
||||
if ( this == consoleWindow )
|
||||
{
|
||||
consoleWindow = NULL;
|
||||
|
|
Loading…
Reference in New Issue