Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
  • BornAgain BornAgain
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 191
    • Issues 191
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 2
    • Merge requests 2
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Container Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Metrics
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • mlzmlz
  • BornAgainBornAgain
  • Merge requests
  • !2

Fix some memory issues

  • Review changes

  • Download
  • Email patches
  • Plain diff
Merged Beerwerth, Randolf requested to merge develop-memory into develop Mar 08, 2021
  • Overview 0
  • Commits 5
  • Pipelines 2
  • Changes 9

This fixes a memory leak in the multilayer. Furthermore in the unit tests correct release of acquired memory is ensured.

  • The clone created in MultiLayer::addLayerWithTopRoughness is passed by reference into addLayer. There it is cloned again. After returning to MultiLayer::addLayerWithTopRoughness the clone created here is lost in space.
  • The addLayerWithTopRoughness method performs a clone. Hence the behavior of a multilayer is not changed, it is still fully cloned. No manual tests in GUI etc. were performed.
  • The primary reason to cleanly release resources is to enable use of a debugger for memory leak detection on the unit tests (that is how i discovered the MultiLayer leak). If they are not cleaned properly, it is impossible to run the debugger on that to look for such issues. Furthermore, cleanly doing that teaches a user who looks into the examples where she takes over ownership of the ressources and needs to assure deletion afterwards. For me, unit tests are always an important example to learn the intented use of structures and other things. Hence i find it incredibly important that they are used correctly in those tests.
Edited Mar 08, 2021 by Beerwerth, Randolf
Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: develop-memory