Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • openfoam openfoam
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 426
    • Issues 426
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 9
    • Merge requests 9
  • Deployments
    • Deployments
    • Releases
  • Wiki
    • Wiki
  • Activity
  • Graph
  • Create a new issue
  • Commits
  • Issue Boards
Collapse sidebar
  • Development
  • openfoamopenfoam
  • Issues
  • #1035
Closed
Open
Issue created Oct 09, 2018 by Mark OLESEN@markMaintainer

Bad alloc/free whe setting PtrList, UPtrList twice

Example code,

PtrList<T> list(2);
list.set(0, ptr0);

// reorder, reorganization etc ...
list.set(0, ptr0update);
list.set(1, ptr1);

The problem being that the second call to list.set(1, ptr1) returns an autoPtr to the old pointer for memory management. This autoPtr contains a managed pointer to ptr1 which will get freed although ptr1 should still be under management of the PtrList.

Change: Setting the PtrList entry to the same pointer address should be a no-op and return a nullptr.

Assignee
Assign to
Time tracking