mirror of
https://github.com/cookiengineer/audacity
synced 2025-10-16 15:41:11 +02:00
Patch by Chris Wilson to fix memory leak in NearestZeroCrossing(). I found another one in the same function and modified this patch to fix that as well.
This commit is contained in:
@@ -2587,6 +2587,7 @@ double AudacityProject::NearestZeroCrossing(double t0)
|
|||||||
dist[i] += 0.1 * (abs(i - windowSize/2)) / float(windowSize/2);
|
dist[i] += 0.1 * (abs(i - windowSize/2)) / float(windowSize/2);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
delete [] oneDist;
|
||||||
track = iter.Next();
|
track = iter.Next();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2600,6 +2601,8 @@ double AudacityProject::NearestZeroCrossing(double t0)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
delete [] dist;
|
||||||
|
|
||||||
return t0 + (argmin - windowSize/2)/GetRate();
|
return t0 + (argmin - windowSize/2)/GetRate();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user