mirror of
https://github.com/safing/portmaster
synced 2025-04-23 04:19:10 +00:00
[service] Submit state clear event outside of lock
This commit is contained in:
parent
c6ddaf8e1e
commit
de4cb5b34f
1 changed files with 3 additions and 3 deletions
|
@ -149,11 +149,11 @@ func (m *StateMgr) Remove(id string) {
|
|||
// Clear removes all states.
|
||||
func (m *StateMgr) Clear() {
|
||||
m.statesLock.Lock()
|
||||
defer m.statesLock.Unlock()
|
||||
|
||||
m.states = nil
|
||||
m.statesLock.Unlock()
|
||||
|
||||
m.statesEventMgr.Submit(m.export())
|
||||
// Submit event without lock, because callbacks might come back to change states.
|
||||
defer m.statesEventMgr.Submit(m.Export())
|
||||
}
|
||||
|
||||
// Export returns the current states.
|
||||
|
|
Loading…
Add table
Reference in a new issue