aboutsummaryrefslogtreecommitdiffstats
path: root/event/event.go
diff options
context:
space:
mode:
Diffstat (limited to 'event/event.go')
-rw-r--r--event/event.go3
1 files changed, 3 insertions, 0 deletions
diff --git a/event/event.go b/event/event.go
index 57dd52baa..fd0bcfbd4 100644
--- a/event/event.go
+++ b/event/event.go
@@ -66,6 +66,9 @@ func (mux *TypeMux) Subscribe(types ...interface{}) Subscription {
mux.mutex.Lock()
defer mux.mutex.Unlock()
if mux.stopped {
+ // set the status to closed so that calling Unsubscribe after this
+ // call will short curuit
+ sub.closed = true
close(sub.postC)
} else {
if mux.subm == nil {