Add heartbeat monitoring in release builds.

This commit is contained in:
2025-07-20 18:45:42 +08:00
parent 7c35dc7cf7
commit 9ed8f351c7

View File

@@ -99,13 +99,16 @@ bool FlutterWindow::OnCreate() {
result->Success(flutter::EncodableValue("No Proxy")); result->Success(flutter::EncodableValue("No Proxy"));
delete(res); delete(res);
} }
#ifdef NDEBUG
else if (call.method_name() == "heartBeat") { else if (call.method_name() == "heartBeat") {
if (monitorThread == nullptr) { if (monitorThread == nullptr) {
monitorThread = new std::thread{ monitorUIThread }; monitorThread = new std::thread{ monitorUIThread };
} }
lastHeartbeat = std::chrono::steady_clock::now(); lastHeartbeat = std::chrono::steady_clock::now();
result->Success(); result->Success();
} }
#endif
}); });
flutter::EventChannel<> channel2( flutter::EventChannel<> channel2(