Commit 511d7a82 authored by Jeromy's avatar Jeromy

increase refcount before dropping dialsLk initially

parent 41d999eb
...@@ -36,7 +36,6 @@ type activeDial struct { ...@@ -36,7 +36,6 @@ type activeDial struct {
} }
func (dr *activeDial) wait(ctx context.Context) (*Conn, error) { func (dr *activeDial) wait(ctx context.Context) (*Conn, error) {
dr.incref()
defer dr.decref() defer dr.decref()
select { select {
case <-dr.waitch: case <-dr.waitch:
...@@ -97,6 +96,9 @@ func (ds *DialSync) getActiveDial(p peer.ID) *activeDial { ...@@ -97,6 +96,9 @@ func (ds *DialSync) getActiveDial(p peer.ID) *activeDial {
go actd.start(adctx) go actd.start(adctx)
} }
// increase ref count before dropping dialsLk
actd.incref()
return actd return actd
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment