From fa2217305bf03cd37545880a79825cd0d13a9a73 Mon Sep 17 00:00:00 2001 From: Dylan Date: Thu, 27 Jul 2023 10:36:42 +0100 Subject: [PATCH] Fixed deadlock when restarting (#157) --- sourcehost.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/sourcehost.go b/sourcehost.go index cad322a..3f638c7 100644 --- a/sourcehost.go +++ b/sourcehost.go @@ -196,9 +196,8 @@ func (sh *SourceHost) ExpandQuery(q *sdp.Query) map[*sdp.Query][]Source { // ClearAllSources Removes all sources func (sh *SourceHost) ClearAllSources() { sh.sourceMapMutex.Lock() - defer sh.sourceMapMutex.Unlock() - sh.sourceMap = make(map[string][]Source) + sh.sourceMapMutex.Unlock() sh.addBuiltinSources() }