serve dnla: fix crash on graceful exit

Before this change, closing a uninitialised chan would cause a crash.
This commit is contained in:
wuxingzhong 2023-11-01 00:44:25 +08:00 committed by GitHub
parent 23ab6fa3a0
commit 4ab57eb90b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 5 deletions

View File

@ -129,11 +129,10 @@ func newServer(f fs.Fs, opt *dlnaflags.Options) (*server, error) {
FriendlyName: friendlyName,
RootDeviceUUID: makeDeviceUUID(friendlyName),
Interfaces: interfaces,
httpListenAddr: opt.ListenAddr,
f: f,
vfs: vfs.New(f, &vfsflags.Opt),
waitChan: make(chan struct{}),
httpListenAddr: opt.ListenAddr,
f: f,
vfs: vfs.New(f, &vfsflags.Opt),
}
s.services = map[string]UPnPService{