Ignore:
Timestamp:
10/29/06 18:17:38 (18 years ago)
Author:
mattausch
Message:

removed memory leaks

File:
1 edited

Legend:

Unmodified
Added
Removed
  • GTP/trunk/Lib/Vis/Preprocessing/src/HierarchyManager.cpp

    r1692 r1696  
    389389        SplitQueue viewSpaceQueue; 
    390390 
    391         int vspSteps, ospSteps; 
     391        int vspSteps = 0, ospSteps = 0; 
    392392 
    393393        // use sah for evaluating osp tree construction  
     
    451451        // then optimizate view space partition for the current osp 
    452452        // and vice versa until iteration depth is reached. 
     453 
    453454        bool lastSplitWasOsp = true; 
    454455 
     
    948949                SubdivisionCandidate *sc = NextSubdivisionCandidate(splitQueue);  
    949950                 
    950                 float rc = (float)sc->GetRenderCostDecrease() / (mInitialRenderCost - mHierarchyStats.mTotalCost + 1.0f); 
    951                 float mc = (float)sc->GetPvsEntriesIncr() / (float)mHierarchyStats.mPvsEntries;  
    952  
     951                const float priority = sc->GetPriority(); 
     952                 
     953                //float rc = (float)sc->GetRenderCostDecrease() / (mInitialRenderCost - mHierarchyStats.mTotalCost + 1.0f); 
     954                //float mc = (float)sc->GetPvsEntriesIncr() / (float)mHierarchyStats.mPvsEntries;        
    953955                //cout << "dRc: " << sc->GetRenderCostDecrease() << " dMem: " << sc->GetPvsEntriesIncr() << " ratio1 " << rc << " ratio2 " << mc << " const: " << 1.0f - GetMemoryConst() << endl; 
    954  
    955                 // minimum slope reached 
    956                 if ((steps > maxSteps) ||  
    957                         ((sc->GetPriority() < threshold) && !(steps < minSteps))) 
    958                 { 
    959                         cout << "\n**************** breaking on " << sc->GetPriority() << " smaller than " << threshold << endl; 
    960                         break; 
    961                 } 
    962956 
    963957                //////// 
     
    969963                if (success) 
    970964                { 
    971                         sc->CollectDirtyCandidates(dirtyCandidates, true); 
     965                        //sc->CollectDirtyCandidates(dirtyCandidates, true); 
    972966                        ++ steps; 
    973967                } 
     968 
     969                DEL_PTR(sc); 
     970 
     971                // minimum slope reached 
     972                if ((steps >= maxSteps) ||  
     973                        ((priority < threshold) && !(steps < minSteps))) 
     974                { 
     975                        cout << "\n**************** breaking on " << priority << " smaller than " << threshold << endl; 
     976                        break; 
     977                } 
     978 
    974979        } 
    975980 
     
    11561161                                                                                  AxisAlignedBox3 *forcedViewSpace) 
    11571162{ 
    1158         // assume object space subdivision constructed 
    1159         //mObjectSpaceSubdivisionType = mSavedObjectSpaceSubdivisionType; 
    1160  
    11611163        const long startTime = GetTime(); 
    11621164        const int limit = mNumMultiLevels; 
     
    15381540        for (oit = objects.begin(); oit != oit_end; ++ oit) 
    15391541        { 
    1540                 (*oit)->mVssRays.clear(); 
     1542                (*oit)->DelRayRefs(); 
    15411543        } 
    15421544} 
Note: See TracChangeset for help on using the changeset viewer.