fix segmentation fault

This commit is contained in:
Will McGugan
2022-08-17 10:06:25 +01:00
parent d7656abb82
commit 11191b2109
3 changed files with 4 additions and 3 deletions

View File

@@ -1071,8 +1071,8 @@ class App(Generic[ReturnType], DOMNode):
async def shutdown(self): async def shutdown(self):
await self._disconnect_devtools() await self._disconnect_devtools()
driver = self._driver driver = self._driver
assert driver is not None if driver is not None:
driver.disable_input() driver.disable_input()
await self.close_messages() await self.close_messages()
def refresh(self, *, repaint: bool = True, layout: bool = False) -> None: def refresh(self, *, repaint: bool = True, layout: bool = False) -> None:

View File

@@ -37,7 +37,6 @@ from .geometry import Offset, Region, Size, Spacing, clamp
from .layouts.vertical import VerticalLayout from .layouts.vertical import VerticalLayout
from .message import Message from .message import Message
from .reactive import Reactive, watch from .reactive import Reactive, watch
from .renderables.align import Align
if TYPE_CHECKING: if TYPE_CHECKING:

View File

@@ -77,3 +77,5 @@ async def test_screens():
# Check we can't pop last screen # Check we can't pop last screen
with pytest.raises(ScreenStackError): with pytest.raises(ScreenStackError):
app.pop_screen() app.pop_screen()
await app.shutdown()