mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: additional PtrList constructor and memory management method
- PtrList::release() method.
Similar to autoPtr and unique_ptr and clearer in purpose than
using set(i,nullptr)
- Construct from List of pointers, taking ownership.
Useful when upgrading code. Eg,
List<polyPatch*> oldList = ...;
PtrList<polyPatch> newList(oldList);
...
BUG: incorrect resizing method names (PtrDynList) in previously unused code
This commit is contained in:
committed by
Andrew Heather
parent
683817bcab
commit
7795adfcb4
@ -103,7 +103,7 @@ Foam::autoPtr<Foam::functionObject> Foam::functionObjectList::remove
|
||||
oldIndex = *iter;
|
||||
|
||||
// Remove pointer from the old list
|
||||
oldptr = this->set(oldIndex, nullptr);
|
||||
oldptr = this->release(oldIndex);
|
||||
indices_.erase(iter);
|
||||
}
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user