mirror of
https://github.com/PixarAnimationStudios/OpenSubdiv
synced 2025-01-04 06:00:17 +00:00
Fix some meory leaks in adaptive evaluator
- It used to create _computeContext twice. - Ownership of refiner didn't set properly, because Initialize() forces evaluator to drop ownership. So now ownership sets after initialization from topology.
This commit is contained in:
parent
b85324dbf9
commit
f410190cde
@ -80,13 +80,15 @@ OsdUtilAdaptiveEvaluator::Initialize(
|
||||
// create and initialize a refiner, passing "true" for adaptive
|
||||
// to indicate we wish for adaptive refinement rather than uniform
|
||||
OsdUtilRefiner *refiner = new OsdUtilRefiner();
|
||||
_ownsRefiner = true;
|
||||
|
||||
if (not refiner->Initialize(t, true, errorMessage)) {
|
||||
delete refiner;
|
||||
return false;
|
||||
}
|
||||
|
||||
return Initialize(refiner, errorMessage);
|
||||
bool result = Initialize(refiner, errorMessage);
|
||||
_ownsRefiner = true;
|
||||
return result;
|
||||
}
|
||||
|
||||
bool
|
||||
@ -114,10 +116,6 @@ OsdUtilAdaptiveEvaluator::Initialize(
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
_computeContext = OsdCpuComputeContext::Create(fmesh->GetSubdivisionTables(),
|
||||
fmesh->GetVertexEditTables());
|
||||
|
||||
// Three elements (x/y/z) per refined point at every subdivision level
|
||||
// defined by the farMesh. The coarse vertices seed the beginning of
|
||||
// this buffer, and Refine populates the rest based on subdivision
|
||||
|
Loading…
Reference in New Issue
Block a user