Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Feb 11, 2018, 7:19:57 PM (6 years ago)
Author:
landauf
Message:

[AsteroidMining_HS17] fixed a bunch of memory leaks

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/Presentation_HS17_merge/src/modules/asteroidmining/SpicedAsteroidField.cc

    r11667 r11735  
    107107        int pZ;
    108108
    109         Vector3* relPos;
    110 
    111109        for(int gertrud = 0; gertrud<count; ++gertrud){
    112110
     
    119117            pY = round(rnd()*2*this->radius) - radius;
    120118            pZ = round(rnd()*2*this->radius) - radius;
    121             relPos = new Vector3(pX, pY, pZ);
    122             a->setPosition(this->position + *relPos);
     119            Vector3 relPos(pX, pY, pZ);
     120            a->setPosition(this->position + relPos);
    123121
    124122            bool spiced = (rnd() < (this->mDensity)); // Whether the asteroid does drop pickups etc.
     
    128126           
    129127            // Fog is iplemented with billboards (as in asteroidField.lua, that bloke had the idea)
    130             Billboard* bb;
    131128            if(this->foggy && mod(gertrud, 5) == 0){
    132                 bb = new Billboard(this->context);
    133                 bb->setPosition(this->position + *relPos);
     129                Billboard* bb = new Billboard(this->context);
     130                bb->setPosition(this->position + relPos);
    134131                bb->setMaterial("Smoke/Smoke");
    135132                bb->setScale(size);
Note: See TracChangeset for help on using the changeset viewer.