Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
May 9, 2019, 1:56:28 PM (5 years ago)
Author:
pomselj
Message:

Eliminated nullptrs in stones_ that were there due to wrong size of num_stones. Still Seg fault when exiting

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/OrxoBlox_FS19/src/modules/OrxoBlox/OrxoBloxWall.cc

    r12346 r12350  
    2929
    3030
    31     void OrxoBloxWall::createWall(void){
     31    void OrxoBloxWall::createWall(){
    3232        for (unsigned int i=0; i<this->num_Stones_;++i){
    3333            unsigned int j=1 + static_cast<unsigned int>(rnd(2.0f)); //<! random number between 0 and 2;
     
    3535                this->size_ = 9.0f;
    3636                OrxoBloxStones* stone = new OrxoBloxStones(this->getContext());
     37                if (stone == nullptr) {
     38                    std::abort();
     39                }
    3740                this->TotalStones_.push_back(stone);
    3841                this->attach(stone);
     
    5659
    5760        }
     61
     62        this->num_Stones_ = TotalStones_.size();
    5863
    5964
Note: See TracChangeset for help on using the changeset viewer.