Is this array or vector leaking?
Hi,
I have written an xll (an excel dll) and it leaks like hell. Because of how it's built I have a hard time debuggin it. Could this be leaking?
Code:
double test() {
int dynamicSize = 5;
std::vector<double> v(dynamicSize);
double* r = NULL;
r = new double[dynamicSize];
delete [] r;
v.clear();
}
Thanks.
Re: Is this array or vector leaking?
No, there is no leak here.
Re: Is this array or vector leaking?
Quote:
Originally Posted by
panzram
Could this be leaking?
There are no memory leaks in the code you've posted.
Just in case that this is a pseudo code make sure that in your implementation, test() is not returning or throwing an exception between the memory allocation and the memory release.
Regards
Doron