Commit 511d7a82 authored by Jeromy's avatar Jeromy

increase refcount before dropping dialsLk initially

parent 41d999eb
......@@ -36,7 +36,6 @@ type activeDial struct {
}
func (dr *activeDial) wait(ctx context.Context) (*Conn, error) {
dr.incref()
defer dr.decref()
select {
case <-dr.waitch:
......@@ -97,6 +96,9 @@ func (ds *DialSync) getActiveDial(p peer.ID) *activeDial {
go actd.start(adctx)
}
// increase ref count before dropping dialsLk
actd.incref()
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