From d2c7ee8c0a070b9790d5552d3f607ca01e1ab798 Mon Sep 17 00:00:00 2001 From: Wolfy-J Date: Wed, 13 Jun 2018 13:02:38 +0300 Subject: tests! --- static_pool.go | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'static_pool.go') diff --git a/static_pool.go b/static_pool.go index 19fc1d13..80847f6e 100644 --- a/static_pool.go +++ b/static_pool.go @@ -273,10 +273,9 @@ func (p *StaticPool) destroying() bool { // throw invokes event handler if any. func (p *StaticPool) throw(event int, ctx interface{}) { p.mul.Lock() - lsn := p.lsn - p.mul.Unlock() + defer p.mul.Unlock() - if lsn != nil { - lsn(event, ctx) + if p.lsn != nil { + p.lsn(event, ctx) } } -- cgit v1.2.3