Skip to content

Commit f826ab8

Browse files
committed
Prevent leak of timer subcomponents
GODRIVER-432 Change-Id: Id3a0e921c937215b229a4c807373027695bad68c
1 parent cf7d3d6 commit f826ab8

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

core/topology/topology.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -221,6 +221,7 @@ func (t *Topology) SelectServer(ctx context.Context, ss description.ServerSelect
221221
if t.cfg.serverSelectionTimeout > 0 {
222222
ssTimeout := time.NewTimer(t.cfg.serverSelectionTimeout)
223223
ssTimeoutCh = ssTimeout.C
224+
defer ssTimeout.Stop()
224225
}
225226

226227
sub, err := t.Subscribe()

0 commit comments

Comments
 (0)