Skip to content

Commit

Permalink
Merge pull request #10 from opentracing/fix_debug_flag
Browse files Browse the repository at this point in the history
Fix totally broken DebugAssertUseAfterFinish
  • Loading branch information
tbg committed Mar 5, 2016
2 parents bfc68f5 + 22c98bb commit 562a065
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion span.go
Original file line number Diff line number Diff line change
Expand Up @@ -119,9 +119,13 @@ func (s *spanImpl) FinishWithOptions(opts opentracing.FinishOptions) {
if s.tracer.Options.DebugAssertUseAfterFinish {
// This makes it much more likely to catch a panic on any subsequent
// operation since s.tracer is accessed on every call to `Lock`.
pool := s.tracer.spanPool
s.reset()
pool.Put(s)
} else {
s.tracer.spanPool.Put(s)
}
s.tracer.spanPool.Put(s)

}

func (s *spanImpl) SetBaggageItem(restrictedKey, val string) opentracing.Span {
Expand Down

0 comments on commit 562a065

Please sign in to comment.