This archive contains answers to questions sent to Unidata support through mid-2025. Note that the archive is no longer being updated. We provide the archive for reference; many of the answers presented here remain technically correct, even if somewhat outdated. For the most up-to-date information on the use of NSF Unidata software and data services, please consult the Software Documentation first.
> Organization: NOAA/FSL > Keywords: 199401122154.AA26845 Tom, > I've discovered a minor problem that I thought you should know about. > The problem is a memory leak when I get the value of a string attribute. > After looking at the source code, it appears that an NcValues object is > being created and returned to NcTypedComponent::as_string but the object > is never deleted. We have a tool called Purify that does a really nice > job of catching memory leaks and the like. I've attached a CDL, a small > program that demonstrates the problem and the Purify output. Note that > the attribute and the string fetched from the attribute is deleted in > the main program as the documentation recommends. As always, thanks for > looking into to these problems and responding in such a timely manner. Thanks for the bug report. We have Purify also, and I even used it to check for memory leaks in the little example program that comes with the netCDF C++ source, but the interface evidently doesn't get exercised very well by the little example. I'll have to wait until next week to look at this. --Russ