Github user phrocker commented on a diff in the pull request:

    https://github.com/apache/nifi-minifi-cpp/pull/448#discussion_r237139770
  
    --- Diff: nanofi/src/api/nanofi.cpp ---
    @@ -223,13 +226,15 @@ void free_flowfile(flow_file_record *ff) {
         return;
       }
       auto content_repo_ptr = 
static_cast<std::shared_ptr<minifi::core::ContentRepository>*>(ff->crp);
    -  if (content_repo_ptr->get()) {
    +  if (content_repo_ptr->get() && (ff->keepContent == 0)) {
    --- End diff --
    
    Yeah that seems like it could cause issues when freeing the flow file, but 
if they were to do all of this, this means that they've either threaded the 
reads of content or are calling free in the middle of accessing that content? I 
think it's reasonable for each read to "keep the content" because it's not the 
owner. A better way might be to use the reference counting in ResourceClaim but 
we don't presently have that since we make new claim objects. I think what 
you've done is not unreasonable. 


---

Reply via email to