Skip to content

Commit 1f2bfe4

Browse files
committed
try to get past cppcheck
1 parent 2c3017b commit 1f2bfe4

1 file changed

Lines changed: 2 additions & 4 deletions

File tree

sdk/src/trace/tracer_context.cc

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -85,13 +85,11 @@ void TracerContext::AddProcessor(std::unique_ptr<SpanProcessor> processor) noexc
8585
else if (multi_processor_ == nullptr)
8686
{
8787
// a processor exists, but it's not a MultiSpanProcessor. make a new MultiSpanProcessor
88-
std::unique_ptr<MultiSpanProcessor> multi_processor(new MultiSpanProcessor({}));
88+
multi_processor_ = new MultiSpanProcessor({});
89+
std::unique_ptr<MultiSpanProcessor> multi_processor(multi_processor_);
8990
multi_processor->AddProcessor(std::move(processor_));
9091
multi_processor->AddProcessor(std::move(processor));
9192

92-
// duplicate the pointer before it gets type erased
93-
multi_processor_ = multi_processor.get();
94-
9593
processor_ = std::move(multi_processor);
9694
}
9795
else /*if (multi_processor_ != nullptr)*/

0 commit comments

Comments
 (0)