Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 5208 in orxonox.OLD for trunk/src/util


Ignore:
Timestamp:
Sep 19, 2005, 8:36:45 PM (19 years ago)
Author:
bensch
Message:

orxonox/trunk: first fruits of valgrind…. delete[] are fine now :)

Location:
trunk/src/util
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/util/loading/game_loader.cc

    r5195 r5208  
    107107    {
    108108      this->currentCampaign = this->fileToCampaign(campaignName);
    109       delete campaignName;
     109      delete[] campaignName;
    110110    }
    111111//   World* world0 = new World(DEBUG_WORLD_0);
  • trunk/src/util/resource_manager.cc

    r5121 r5208  
    9696  if (isDir(realDir))
    9797    {
    98       delete this->dataDir;
     98      delete[] this->dataDir;
    9999      this->dataDir = new char[strlen(realDir)+1];
    100100      strcpy(this->dataDir, realDir);
     
    126126  sprintf(testFile, "%s%s", this->dataDir, fileInside);
    127127  retVal = isFile(testFile);
    128   delete testFile;
     128  delete[] testFile;
    129129  return retVal;
    130130}
     
    382382    {
    383383      PRINTF(2)("Resource %s could not be loaded\n", fileName);
     384      delete[] tmpResource->name;
    384385      delete tmpResource;
    385386      return NULL;
     
    456457          // deleting the List Entry:
    457458          PRINTF(4)("Resource %s safely removed.\n", resource->name);
    458           delete []resource->name;
     459          delete[] resource->name;
    459460          this->resourceList->remove(resource);
    460461        }
     
    625626      else
    626627        {
    627           delete tmpDirName;
     628          delete[] tmpDirName;
    628629          return false;
    629630        }
     
    653654                            ))
    654655        {
    655           delete tmpFileName;
     656          delete[] tmpFileName;
    656657          return true;
    657658        }
    658659      else
    659660        {
    660           delete tmpFileName;
     661          delete[] tmpFileName;
    661662          return false;
    662663        }
     
    664665  else
    665666    {
    666       delete tmpFileName;
     667      delete[] tmpFileName;
    667668      return false;
    668669    }
     
    682683    {
    683684      PRINTF(1)("could not open %s fro writing\n", fileName);
     685      delete[] tmpName;
    684686      return false;
    685687    }
    686688  fclose(stream);
    687689
    688   delete tmpName;
     690  delete[] tmpName;
    689691}
    690692
     
    699701  char* tmpName = ResourceManager::homeDirCheck(fileName);
    700702  unlink(tmpName);
    701   delete tmpName;
     703  delete[] tmpName;
    702704}
    703705
     
    748750  else
    749751    {
    750       delete retName;
     752      delete[] retName;
    751753      return NULL;
    752754    }
Note: See TracChangeset for help on using the changeset viewer.