Skip to content

Fix memory leak in merge macro#147

Closed
cmargalejo wants to merge 1 commit into
masterfrom
cris_fix_merge_macro_memory_leak
Closed

Fix memory leak in merge macro#147
cmargalejo wants to merge 1 commit into
masterfrom
cris_fix_merge_macro_memory_leak

Conversation

@cmargalejo
Copy link
Copy Markdown
Member

@cmargalejo cmargalejo commented Apr 16, 2026

cmargalejo Ok: 1 Powered by Pull Request Badge

  • Add missing delete mergeRun after CloseFile() in REST_Geant4_MergeRestG4Files macro
  • Without this, each merge operation leaks the entire TRestRun object
  • Together with the TRestRun::CloseFile fix (Fix memory leak in TRestRun::CloseFile framework#562), this resolves the memory growth when merging a large number of files

Relates to rest-for-physics/framework#519

@rest-for-physics/geant4lib

  Add missing delete mergeRun after CloseFile() in
  REST_Geant4_MergeRestG4Files. Without this, each merge
  operation leaks the entire TRestRun object.

  Relates to rest-for-physics/framework#519
@juanangp
Copy link
Copy Markdown
Member

Looking at the merge conflit, it seems that you are working on a old version of this library.
I think that current version in which mergeRun is not a pointer shouldn't cause any memory leak, so I guess you can close this PR.

@cmargalejo
Copy link
Copy Markdown
Member Author

You're right, thanks for pointing it out! I was working on an older version of the submodule where mergeRun was still a pointier. This submodule structure is not very straightforward I think... I close this.

@cmargalejo cmargalejo closed this Apr 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants