Skip to content

Commit 8bb925c

Browse files
committed
Release principals in TestSourceProcessor
Need to release the principal before asking for one from the cache.
1 parent 1303e05 commit 8bb925c

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

FWCore/TestProcessor/src/TestSourceProcessor.cc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,10 @@ namespace edm::test {
259259
ServiceRegistry::Operate operate(serviceToken_);
260260

261261
//NOTE: should probably handle merging as well
262+
//if there is only one principal, we need to return it to the cache first
263+
runPrincipal_.reset();
262264
runPrincipal_ = principalCache_.getAvailableRunPrincipalPtr();
265+
assert(runPrincipal_);
263266
runPrincipal_->possiblyUpdateAfterAddition(preg_);
264267
runPrincipal_->setAux(*source_->runAuxiliary());
265268
source_->readRun(*runPrincipal_, *historyAppender_);
@@ -276,6 +279,8 @@ namespace edm::test {
276279
//make the services available
277280
ServiceRegistry::Operate operate(serviceToken_);
278281

282+
//if there is only one principal, we need to return it to the cache first
283+
lumiPrincipal_.reset();
279284
lumiPrincipal_ = principalCache_.getAvailableLumiPrincipalPtr();
280285
assert(lumiPrincipal_);
281286
lumiPrincipal_->possiblyUpdateAfterAddition(preg_);

0 commit comments

Comments
 (0)