The problem actually exists, but it is more complicated as it seems: the
mentioned method ReallocateStack is completely wrong by initial intent -- it
reallocates memory moving it to another address, while the pointers to original
memory location are still living (both outside and inside the stack).
It seems that this 'stack manager' has been created in attempt to optimise
memory allocation yet before creation of OCC memory manager. It is better just
to remove it and replace calls to it (found just in two places in the same
package: math_SingleTab and math_DoubleTab) to either standard malloc/free, or
to OCC MAllocate/MFree.
Also file math_MemoryManagement.hxx is not used and should be removed
The fix follows (see attachments)
Steps To Reproduce
Additional information and documentation updates
Documentation remark, added by abv 2004-07-06 06:42:41:
Specific (stack-like) memory allocation mechanism used in array classes from
math package (such as math_RealVector) is replaced by usage of standard Open
CASCADE memory manager (from package Standard). This both optimises memory usage
and allows to avoid potential memory leaks (that might happen previously in case
of allocation of big amounts of memory in several arrays simultaneously).
math_StackManager.hxx and .cxx, math_MemoryManagement.hxx: deleted
math_SingleTab.gxx and math_DoubleTab.gxx: calls to math_StackManager functions
replaced by equivalent calls to Standard::Allocate() and Standard::Free()