Ver código fonte

Merge remote-tracking branch 'origin/release/1.9.x'

rdb 9 anos atrás
pai
commit
ba4c38112c

+ 1 - 1
dtool/src/dtoolutil/executionEnvironment.cxx

@@ -247,7 +247,7 @@ ns_get_environment_variable(const string &var) const {
   } else if (var == "MAIN_DIR") {
     // Return the binary name's parent directory.  If we're running inside the
     // Python interpreter, this will be overridden by a setting from
-    // panda3dcore.py.
+    // panda3d/core.py.
     if (!_binary_name.empty()) {
       Filename main_dir (_binary_name);
       main_dir.make_absolute();

+ 1 - 1
dtool/src/dtoolutil/pfstreamBuf.cxx

@@ -121,7 +121,7 @@ int PipeStreamBuf::underflow(void) {
 #endif /* PHAVE_IOSTREAM */
     gbump(-((int)n));
   }
-  delete buf;
+  delete[] buf;
   return ret;
 }
 

+ 2 - 2
panda/src/downloader/download_utils.cxx

@@ -40,7 +40,7 @@ check_crc(Filename name) {
   unsigned long crc = crc32(0L, Z_NULL, 0);
   crc = crc32(crc, (unsigned char *)buffer, buffer_length);
 
-  delete buffer;
+  delete[] buffer;
 
   return crc;
 }
@@ -66,7 +66,7 @@ check_adler(Filename name) {
   unsigned long adler = adler32(0L, Z_NULL, 0);
   adler = adler32(adler, (unsigned char *)buffer, buffer_length);
 
-  delete buffer;
+  delete[] buffer;
 
   return adler;
 }

+ 1 - 1
panda/src/pnmimagetypes/pnmFileTypeJPGWriter.cxx

@@ -319,7 +319,7 @@ write_data(xel *array, xelval *) {
     row_pointer[0] = row;
     (void) jpeg_write_scanlines(&cinfo, row_pointer, 1);
   }
-  delete row;
+  delete[] row;
 
   /* Step 6: Finish compression */
 

+ 2 - 2
samples/music-box/main.py

@@ -41,7 +41,7 @@ class MusicBox(DirectObject):
 
         # Loading sounds is done in a similar way to loading other things
         # Loading the main music box song
-        self.musicBoxSound = base.loadMusic('music/musicbox.ogg')
+        self.musicBoxSound = loader.loadMusic('music/musicbox.ogg')
         self.musicBoxSound.setVolume(.5)  # Volume is a percentage from 0 to 1
         # 0 means loop forever, 1 (default) means
         # play once. 2 or higher means play that many times
@@ -69,7 +69,7 @@ class MusicBox(DirectObject):
         # Loading the open/close effect
         # loadSFX and loadMusic are identical. They are often used for organization
         #(loadMusic is used for background music, loadSfx is used for other effects)
-        self.lidSfx = base.loadSfx('music/openclose.ogg')
+        self.lidSfx = loader.loadSfx('music/openclose.ogg')
         # The open/close file has both effects in it. Fortunatly we can use intervals
         # to easily define parts of a sound file to play
         self.lidOpenSfx = SoundInterval(self.lidSfx, duration=2, startTime=0)