mirror of
https://bitbucket.org/cosmicvoids/vide_public.git
synced 2025-07-04 15:21:11 +00:00
Correct memory cleanup.
This commit is contained in:
parent
b555533fa3
commit
33b32ea43d
1 changed files with 13 additions and 10 deletions
|
@ -14,13 +14,7 @@ using boost::format;
|
|||
|
||||
void doWatershed(PARTICLE *p, pid_t np, ZONE *z, int numZones, float maxvol, float voltol)
|
||||
{
|
||||
char *inyet, *inyet2;
|
||||
int *zonelist, *zonelist2;
|
||||
int nhl;
|
||||
int *links = new int[NLINKS];
|
||||
int *iord;
|
||||
float maxdenscontrast = 0;
|
||||
bool *done_zones;
|
||||
|
||||
double *sorter = new double[numZones+1];
|
||||
/* Assign sorter by probability (could use volume instead) */
|
||||
|
@ -38,6 +32,12 @@ void doWatershed(PARTICLE *p, pid_t np, ZONE *z, int numZones, float maxvol, flo
|
|||
|
||||
#pragma omp parallel
|
||||
{
|
||||
char *inyet, *inyet2;
|
||||
int *zonelist, *zonelist2;
|
||||
int nhl;
|
||||
int *links = new int[NLINKS];
|
||||
bool *done_zones;
|
||||
|
||||
inyet = new char[numZones];
|
||||
inyet2 = new char[numZones];
|
||||
zonelist = new int[numZones];
|
||||
|
@ -218,11 +218,14 @@ void doWatershed(PARTICLE *p, pid_t np, ZONE *z, int numZones, float maxvol, flo
|
|||
delete[] zonelist;
|
||||
delete[] zonelist2;
|
||||
delete[] links;
|
||||
delete[] iord;
|
||||
|
||||
}
|
||||
delete[] inyet;
|
||||
delete[] inyet2;
|
||||
delete[] done_zones;
|
||||
|
||||
maxdenscontrast = 0;
|
||||
}
|
||||
delete[] iord;
|
||||
|
||||
double maxdenscontrast = 0;
|
||||
#pragma omp parallel shared(maxdenscontrast)
|
||||
{
|
||||
double maxdenscontrast_local = 0;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue