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)
|
consoleWin_t::~consoleWin_t(void)
|
||||||
{
|
{
|
||||||
|
QClipboard *clipboard;
|
||||||
|
|
||||||
nes_shm->runEmulator = 0;
|
nes_shm->runEmulator = 0;
|
||||||
|
|
||||||
gameTimer->stop();
|
gameTimer->stop();
|
||||||
|
@ -132,6 +134,18 @@ consoleWin_t::~consoleWin_t(void)
|
||||||
g_config->setOption ("SDL.NetworkIP", "");
|
g_config->setOption ("SDL.NetworkIP", "");
|
||||||
g_config->save ();
|
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 )
|
if ( this == consoleWindow )
|
||||||
{
|
{
|
||||||
consoleWindow = NULL;
|
consoleWindow = NULL;
|
||||||
|
|
Loading…
Reference in New Issue