Skip to content

Commit

Permalink
Explicitly clean up grabs on disconnect
Browse files Browse the repository at this point in the history
They are not automatically cleaned up with the window on Windows, and we
might want to reconnect so we cannot rely on the process cleanup either.
  • Loading branch information
CendioOssman committed Sep 23, 2024
1 parent 2fe9dca commit 43ce674
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions vncviewer/DesktopWindow.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,11 @@ DesktopWindow::DesktopWindow(int w, int h, const char *name,

DesktopWindow::~DesktopWindow()
{
// Don't leave any dangling grabs as they are not automatically
// cleaned up on all platforms
ungrabPointer();
ungrabKeyboard();

// Unregister all timeouts in case they get a change tro trigger
// again later when this object is already gone.
Fl::remove_timeout(handleGrab, this);
Expand Down

0 comments on commit 43ce674

Please sign in to comment.