[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: 20020313: ncendef error (fwd)



>From: "V. Lakshmanan" <address@hidden>
>Subject: ncendef error ...
>Organization: National Severe Storms Laboratory
>Keywords: 200203131925.g2DJPSa00726 netCDF ncendef

------- Forwarded Message

Date:    Thu, 21 Mar 2002 09:57:24 -0600
From:    "V. Lakshmanan" <address@hidden>
To:      Russ Rew <address@hidden>
cc:      address@hidden
Subject: Re: 20020313: ncendef error

On Wednesday 20 March 2002 04:34 pm, you wrote:

> The C++ interface makes the user responsible for deleting
> some of the returned values and arrays, so it may not be enough to
> just have the destructor call close.  I think you mentioned that
> the process was not running out of memory, but this still might be
> worth checking:
>
>   ... Member functions that return pointers to attributes (`NcAtt')
>   pass ownership to the calling function; users should delete
>   attributes when they are finished with them.


aaah ... I missed that notice in the documentation.  I've replaced all
the places in my code where I did this:

  NcAtt* elev = ncfile.get_att( "Elevation"  );

with

  std::auto_ptr<NcAtt> elev =  ncfile.get_att( "Elevation"  );
i.e delete this when it goes out of scope ...

and have restarted the program, will let you know if the resource
problem shows up again.

thanks for the help.
Lak

------- End of Forwarded Message