Open malkarouri opened 3 weeks ago
Hi,
Thank you for opening this issue. I don't have a Mac to test this, but try this: in the flaskwebgui.py source file on line 256 add the following:
if OPERATING_SYSTEM == "darwin":
multiprocessing.set_start_method("fork")
before FLASKWEBGUI_BROWSER_PROCESS = subprocess.Popen(self.browser_command)
.
Please tell me if that fixes the issue or not.
I am using Python 3.12 on MacOS 14.6, using FastAPI. I am using the exact code to close application as shown in the application. The browser is not closed on pressing the Close button. The server shuts down, but Chrome stays open with a clear page (or whatever the
Close
function returns after callingclose_application
.I can trace the issue to the way the
run
function works in FlaskUI for MacOS (Darwin). It seems that therun
functions starts a new process. The value of the global variableFLASKWEBGUI_BROWSER_PROCESS
is not shared between the old and new process, causing the call toclose_application
to find the process value asNone
and not terminate it.