Skip to content
This repository has been archived by the owner on May 26, 2022. It is now read-only.

Commit

Permalink
increase refcount before dropping dialsLk initially
Browse files Browse the repository at this point in the history
  • Loading branch information
whyrusleeping committed Oct 29, 2016
1 parent 41d999e commit 511d7a8
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion dial_sync.go
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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
}

Expand Down

0 comments on commit 511d7a8

Please sign in to comment.