Github user phrocker commented on the issue:

    https://github.com/apache/nifi-minifi-cpp/pull/439
  
    > There is no delete, it was wrong before, this PR just fixes:
    > 
    > ```
    > void free_flowfile(flow_file_record *ff) {
    >   if (ff == nullptr) {
    >     return;
    >   }
    >   auto content_repo_ptr = 
static_cast<std::shared_ptr<minifi::core::ContentRepository>*>(ff->crp);
    >   if (content_repo_ptr->get()) {
    >     std::shared_ptr<minifi::ResourceClaim> claim = 
std::make_shared<minifi::ResourceClaim>(ff->contentLocation, *content_repo_ptr);
    >     (*content_repo_ptr)->remove(claim);
    >   }
    >   if (ff->ffp == nullptr) {
    >     auto map = static_cast<string_map*>(ff->attributes);
    >     delete map;
    >   }
    >   free(ff->contentLocation);
    >   free(ff);
    > ```
    > The last line is the one that frees.
    
    Ah sorry, I was referencing the fact that over the course of PRs we've gone 
back and forth a little between malloc/new. There is a free_flow(flow *) that 
still uses delete. Happy to see a different PR if you prefer to do that, but it 
all falls under the guise of this ticket IMO. Would you prefer I merge this and 
then keep the ticket open as a blocker for the free? No real preference on my 
part. 


---

Reply via email to