From f155b67ef6f6e5e3921b5e5a16b272610898ccb1 Mon Sep 17 00:00:00 2001 From: josephemorgan Date: Wed, 18 Mar 2026 12:17:35 -0700 Subject: [PATCH] fix(devtools): stop DevTools server on flutter shutdown on_flutter_shutdown() only cleared profiler_url and devtools_profiler_url but left devtools_url, devtools_pid, and the DevTools server process alive. After quit and relaunch in debug mode, the stale devtools_url caused the browser to open with the old port instead of the new one. Call M.stop() in on_flutter_shutdown() to kill the DevTools process and clear all state so the next launch starts fresh. --- lua/flutter-tools/dev_tools.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/lua/flutter-tools/dev_tools.lua b/lua/flutter-tools/dev_tools.lua index eecd071d..d94d07b9 100644 --- a/lua/flutter-tools/dev_tools.lua +++ b/lua/flutter-tools/dev_tools.lua @@ -233,6 +233,7 @@ function M.get_profiler_url() end function M.on_flutter_shutdown() + M.stop() profiler_url = nil devtools_profiler_url = nil end