Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 5216 in orxonox.OLD for trunk/src


Ignore:
Timestamp:
Sep 22, 2005, 4:44:56 PM (19 years ago)
Author:
bensch
Message:

orxonox/trunk: more fixes due to valgrind

Location:
trunk/src
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/lib/graphics/graphics_engine.cc

    r5124 r5216  
    168168void GraphicsEngine::setWindowName(const char* windowName, const char* icon)
    169169{
    170   SDL_WM_SetIcon(SDL_LoadBMP(icon), NULL);
    171 
     170  SDL_Surface* iconSurf = SDL_LoadBMP(icon);
     171
     172  SDL_WM_SetIcon(iconSurf, NULL);
    172173  SDL_WM_SetCaption (windowName, icon);
     174
     175  delete iconSurf;
    173176}
    174177
     
    211214    {
    212215      PRINTF(1)("Could not SDL_SetVideoMode(%d, %d, %d, %d): %s\n", this->resolutionX, this->resolutionY, this->bitsPerPixel, this->videoFlags, SDL_GetError());
    213       SDL_Quit();
     216      //    SDL_Quit();
    214217      //    return -1;
    215218    }
  • trunk/src/lib/graphics/graphics_engine.h

    r5084 r5216  
    2828    virtual ~GraphicsEngine();
    2929    /** @returns a Pointer to the only object of this Class */
    30     inline static GraphicsEngine* getInstance() { if (!singletonRef) singletonRef = new GraphicsEngine();  return singletonRef; };
     30    inline static GraphicsEngine* getInstance() { if (!GraphicsEngine::singletonRef) GraphicsEngine::singletonRef = new GraphicsEngine();  return GraphicsEngine::singletonRef; };
    3131
    3232    int init();
  • trunk/src/lib/graphics/importer/model.cc

    r5211 r5216  
    9292  this->faceCount = 0;
    9393  this->next = NULL;
     94  this->listNumber = 0;
    9495
    9596  this->firstFace = new ModelFace;
     
    108109  if (this->next !=NULL)
    109110    delete this->next;
     111
     112  //  if (this->listNumber != 0)
     113//    glDeleteLists(this->listNumber, 1);
    110114}
    111115
  • trunk/src/lib/physics/physics_engine.cc

    r5211 r5216  
    7070//   }
    7171//   delete itPI;
    72 //   delete this->interfaces;
     72   delete this->interfaces;
    7373//
    7474//   // delete all PhysicsFields, still in existence (this could be dangerous)
  • trunk/src/lib/sound/sound_engine.h

    r4985 r5216  
    7474    virtual ~SoundEngine();
    7575    /** @returns a Pointer to the only object of this Class */
    76     inline static SoundEngine* getInstance() { if (!singletonRef) singletonRef = new SoundEngine();  return singletonRef; };
     76    inline static SoundEngine* getInstance() { if (!SoundEngine::singletonRef) SoundEngine::singletonRef = new SoundEngine();  return SoundEngine::singletonRef; };
    7777
    7878    void loadSettings(IniParser* iniParser);
  • trunk/src/orxonox.cc

    r5210 r5216  
    271271  }
    272272   //! @todo this is a hack and should be loadable
    273   ResourceManager::getInstance()->addImageDir(ResourceManager::getInstance()->getFullName("maps/"));
    274   ResourceManager::getInstance()->debug();
     273  char* imageDir = ResourceManager::getInstance()->getFullName("maps/");
     274  ResourceManager::getInstance()->addImageDir(imageDir);
     275  delete[] imageDir;
    275276
    276277  PRINT(3)("initializing TextEngine\n");
  • trunk/src/story_entities/campaign.cc

    r5215 r5216  
    294294        {
    295295          //printf("Campaing::getStoryEntity() - yea, this is what we where looking for: %id\n");
     296          delete iterator;
    296297          return entity;
    297298        }
  • trunk/src/story_entities/world.cc

    r5211 r5216  
    381381  localCamera->setClipRegion(1, 10000.0);
    382382  this->localPlayer->setParentMode(PNODE_ALL);
    383   Vector* cameraOffset = new Vector (0, 5, -10);
    384383  TrackManager::getInstance()->condition(1, LEFTRIGHT, this->localPlayer);
    385384
  • trunk/src/util/resource_manager.cc

    r5211 r5216  
    374374          break;
    375375        }
    376       if (tmpResource->pointer)
     376      if (tmpResource->pointer != NULL)
    377377        this->resourceList->add(tmpResource);
    378378      delete[] fullName;
    379379    }
    380   if (tmpResource->pointer)
     380  if (tmpResource->pointer != NULL)
    381381    return tmpResource->pointer;
    382382  else
  • trunk/src/world_entities/weapons/crosshair.cc

    r5212 r5216  
    190190//   glEnd();
    191191  glPushMatrix();
    192   GLdouble pos[3];
     192  GLdouble pos[3] = { 0.0, 0.0, 0.0};
    193193  gluProject(this->getAbsCoor().x,
    194194             this->getAbsCoor().y,
Note: See TracChangeset for help on using the changeset viewer.