From c24c40dfee76f413a82919578534f4a4b0f0a903 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B8=96=E7=95=8C?= Date: Tue, 11 Mar 2025 20:18:24 +0800 Subject: [PATCH] platform: Fix android start --- experimental/libbox/monitor.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/experimental/libbox/monitor.go b/experimental/libbox/monitor.go index eac0026d..05973ec6 100644 --- a/experimental/libbox/monitor.go +++ b/experimental/libbox/monitor.go @@ -56,7 +56,12 @@ func (m *platformDefaultInterfaceMonitor) UnregisterCallback(element *list.Eleme func (m *platformDefaultInterfaceMonitor) UpdateDefaultInterface(interfaceName string, interfaceIndex32 int32, isExpensive bool, isConstrained bool) { if sFixAndroidStack { - go m.updateDefaultInterface(interfaceName, interfaceIndex32, isExpensive, isConstrained) + done := make(chan struct{}) + go func() { + m.updateDefaultInterface(interfaceName, interfaceIndex32, isExpensive, isConstrained) + close(done) + }() + <-done } else { m.updateDefaultInterface(interfaceName, interfaceIndex32, isExpensive, isConstrained) }