Skip to content

Commit 5d70b21

Browse files
Roland Lichtersjenkins
authored andcommitted
QPR-12433 update the second run method...
1 parent 279ded8 commit 5d70b21

1 file changed

Lines changed: 12 additions & 9 deletions

File tree

OREAnalytics/orea/app/oreapp.cpp

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -423,22 +423,25 @@ void OREApp::run() {
423423
void OREApp::run(const std::vector<std::string>& marketData,
424424
const std::vector<std::string>& fixingData) {
425425

426-
// only one thread at a time should call run
426+
// Only one thread at a time should call run
427427
static std::mutex _s_mutex;
428428
std::lock_guard<std::mutex> lock(_s_mutex);
429429

430-
// clean up after finishing the run
431-
CleanUpThreadLocalSingletons cleanupThreadLocalSingletons;
432-
CleanUpThreadGlobalSingletons cleanupThreadGloablSingletons;
433-
CleanUpLogSingleton cleanupLogSingleton(true, true);
430+
// Clean start, but leave Singletons intact after run is completed
431+
{
432+
CleanUpThreadLocalSingletons cleanupThreadLocalSingletons;
433+
CleanUpThreadGlobalSingletons cleanupThreadGloablSingletons;
434+
CleanUpLogSingleton cleanupLogSingleton(true, true);
435+
}
434436

435-
if (inputs_ == nullptr)
436-
initFromParams();
437-
else if (params_ == nullptr)
437+
// Use inputs when available, otherwise try params
438+
if (inputs_ != nullptr)
438439
initFromInputs();
440+
else if (params_ != nullptr)
441+
initFromParams();
439442
else {
440443
ALOG("both inputs are empty");
441-
return;
444+
return;
442445
}
443446

444447
runTimer_.start();

0 commit comments

Comments
 (0)