Skip to content

Commit 0587ec8

Browse files
author
BoboTiG
committed
Linux: fix segfault du to double call to _cleanup() which called twice xlib.XCloseDisplay() on an already closed display
1 parent ca0a7bf commit 0587ec8

1 file changed

Lines changed: 1 addition & 5 deletions

File tree

mss/linux.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -78,11 +78,6 @@ def __del__(self):
7878

7979
self._cleanup()
8080

81-
def __exit__(self, exc_type, exc_value, traceback):
82-
''' Quit. '''
83-
84-
self._cleanup()
85-
8681
def __init__(self):
8782
''' GNU/Linux initialisations. '''
8883

@@ -134,6 +129,7 @@ def _cleanup(self):
134129
try:
135130
if self.display:
136131
self.xlib.XCloseDisplay(self.display)
132+
self.display = None
137133
except AttributeError:
138134
pass
139135

0 commit comments

Comments
 (0)