ソースを参照

Preventive fixes for some unlikely memory issues

rdb 15 年 前
コミット
80dba4efd6

+ 1 - 1
panda/src/display/displayInformation.cxx

@@ -23,7 +23,7 @@
 DisplayInformation::
 ~DisplayInformation() {
   if (_display_mode_array != NULL) {
-    delete _display_mode_array;
+    delete[] _display_mode_array;
   }
   if (_cpu_id_data != NULL) {
     delete _cpu_id_data;

+ 3 - 1
panda/src/display/graphicsStateGuardian.cxx

@@ -58,7 +58,7 @@
 #include <limits.h>
 
 #ifdef HAVE_PYTHON
-#include "py_panda.h"  
+#include "py_panda.h"
 #ifndef CPPPARSER
 IMPORT_THIS struct Dtool_PyTypedObject Dtool_Texture;
 #endif
@@ -155,6 +155,7 @@ GraphicsStateGuardian(CoordinateSystem internal_coordinate_system,
   _prepared_objects = new PreparedGraphicsObjects;
   _stereo_buffer_mask = ~0;
   _incomplete_render = allow_incomplete_render;
+  _effective_incomplete_render = false;
   _loader = Loader::get_global_ptr();
 
   _is_hardware = false;
@@ -1748,6 +1749,7 @@ reset() {
   _lighting_enabled = false;
   _num_lights_enabled = 0;
   _num_clip_planes_enabled = 0;
+  _clip_planes_enabled = false;
 
   _color_scale_enabled = false;
   _current_color_scale.set(1.0f, 1.0f, 1.0f, 1.0f);

+ 4 - 0
panda/src/gobj/texture.cxx

@@ -194,6 +194,10 @@ Texture(const string &name) :
   _x_size = 0;
   _y_size = 1;
   _z_size = 1;
+  // Set it to something else first to
+  // avoid the check in do_set_format
+  // depending on an uninitialised value
+  _format = F_rgba;
   do_set_format(F_rgb);
   do_set_component_type(T_unsigned_byte);