stack: Fix close before start

This commit is contained in:
世界 2024-11-12 10:30:18 +08:00
parent 355e4e81cc
commit d105263fed
No known key found for this signature in database
GPG key ID: CD109927C34A63C4
2 changed files with 6 additions and 0 deletions

View file

@ -97,6 +97,9 @@ func (t *GVisor) Start() error {
}
func (t *GVisor) Close() error {
if t.stack == nil {
return nil
}
t.endpoint.Attach(nil)
t.stack.Close()
for _, endpoint := range t.stack.CleanupEndpoints() {

View file

@ -224,6 +224,9 @@ func (m *Mixed) packetLoop() {
}
func (m *Mixed) Close() error {
if m.stack == nil {
return nil
}
m.endpoint.Attach(nil)
m.stack.Close()
for _, endpoint := range m.stack.CleanupEndpoints() {