diff options
author | Wolfy-J <[email protected]> | 2018-06-13 13:02:38 +0300 |
---|---|---|
committer | Wolfy-J <[email protected]> | 2018-06-13 13:02:38 +0300 |
commit | d2c7ee8c0a070b9790d5552d3f607ca01e1ab798 (patch) | |
tree | 14a53d4de55b71a5bd376ddb3ad0edbd0f7f1546 /static_pool.go | |
parent | 9786e79d05beede8c8d21d9281623ff8b2388b08 (diff) |
tests!
Diffstat (limited to 'static_pool.go')
-rw-r--r-- | static_pool.go | 7 |
1 files changed, 3 insertions, 4 deletions
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) } } |