flet-dev / examples

Flet sample applications
MIT License
420 stars 171 forks source link

Flet App close error #124

Closed hikmetalemdaroglu closed 3 months ago

hikmetalemdaroglu commented 3 months ago

'Flet' app window gives the following error when closed with the cross sign.

Here is sample code:

import flet as ft

def main(page: ft.Page):

add/update controls on Page

# pass
t = ft.Text(value="Hello, world!", color="green")
page.controls.append(t)
page.update()
btn = ft.ElevatedButton("Click me!")
page.add(btn)

ft.app(target=main)

ft.app(target=main, view=ft.AppView.WEB_BROWSER)


And here is the error :

%Run flet-002_counter.py

Exception ignored in: <function StreamWriter.del at 0x000001525F2E6660> Traceback (most recent call last): File "d:\wpy64-31160\python-3.11.6.amd64\Lib\asyncio\streams.py", line 395, in del self.close() File "d:\wpy64-31160\python-3.11.6.amd64\Lib\asyncio\streams.py", line 343, in close return self._transport.close() ^^^^^^^^^^^^^^^^^^^^^^^ File "d:\wpy64-31160\python-3.11.6.amd64\Lib\asyncio\proactor_events.py", line 109, in close self._loop.call_soon(self._call_connection_lost, None) File "d:\wpy64-31160\python-3.11.6.amd64\Lib\asyncio\base_events.py", line 761, in call_soon self._check_closed() File "d:\wpy64-31160\python-3.11.6.amd64\Lib\asyncio\base_events.py", line 519, in _check_closed raise RuntimeError('Event loop is closed') RuntimeError: Event loop is closed

hikmetalemdaroglu commented 3 months ago

Note: For issiu 26, ignore the last line. It is closed with #.

ndonkoHenri commented 3 months ago

Give this a check: https://github.com/flet-dev/flet/issues/2848#issuecomment-1988448893