You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@nifi.apache.org by GitBox <gi...@apache.org> on 2020/03/05 14:45:48 UTC

[GitHub] [nifi-minifi-cpp] bakaid commented on a change in pull request #743: Minificpp 1169 - Simplify C2 metrics collection and reporting

bakaid commented on a change in pull request #743: Minificpp 1169 - Simplify C2 metrics collection and reporting
URL: https://github.com/apache/nifi-minifi-cpp/pull/743#discussion_r388337240
 
 

 ##########
 File path: libminifi/src/FlowController.cpp
 ##########
 @@ -449,13 +451,9 @@ void FlowController::initializeC2() {
 
   if (!c2_initialized_) {
     configuration_->setAgentIdentifier(identifier_str);
-    state::StateManager::initialize();
-    std::shared_ptr<c2::C2Agent> agent = std::make_shared<c2::C2Agent>(std::dynamic_pointer_cast<FlowController>(shared_from_this()), std::dynamic_pointer_cast<FlowController>(shared_from_this()),
+    c2_agent_ = std::make_shared<c2::C2Agent>(std::dynamic_pointer_cast<FlowController>(shared_from_this()), std::dynamic_pointer_cast<FlowController>(shared_from_this()),
 
 Review comment:
   This was and still is a `shared_ptr` cycle between `C2Agent` and `FlowController`, which is not a bad practice and the reason for many of our memory leaks.
   Since we are refactoring this we should solve this as well.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services