Re: A malloc error in C++
Re: A malloc error in C++
- Subject: Re: A malloc error in C++
- From: "Shawn Erickson" <email@hidden>
- Date: Wed, 29 Aug 2007 08:06:01 -0700
On 8/29/07, Clark Cox <email@hidden> wrote:
> Here's your problem. Why are you trying to call the destructor directly?
>
> ...
> > zAnalysis.~DataAnalysis();
Giacomo consider doing the following since you are using stack
allocated objects... wrapping them in blocks will scope the life time
of stack allocated objects in that block (of course the compiler would
like see this for itself and may terminate the life times early).
{
GMNLFS::DataAnalysis<vector<double>::iterator,double>
zAnalysis(z.begin(),z.end());
...
zAnalysis.~DataAnalysis();
}
{
GMNLFS::DataAnalysis<vector<double>::iterator,double>
mvAnalysis(mv.begin(),mv.end());
...
mvAnalysis.~DataAnalysis();
}
... etc ...
...or switch to using heap allocated objects using new and delete to
manage their lifetimes.
-Shawn
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden