summaryrefslogtreecommitdiff
path: root/servers/visual
diff options
context:
space:
mode:
authorJuan Linietsky <reduzio@gmail.com>2015-04-20 19:38:02 -0300
committerJuan Linietsky <reduzio@gmail.com>2015-04-20 19:38:02 -0300
commit59154cccf9fcf814a21a2596993fb1b6777d3bb7 (patch)
tree4132620a9d924463dae4b64fea2dde68a14023e7 /servers/visual
parent28c4afeb5733f9ca9725ab2a5f4066af8e02b2a6 (diff)
-Changed Godot exit to be clean.
-Added more debug information on memory cleanliness on exit (if run with -v) -Fixed several memory leaks, fixes #1731, fixes #755
Diffstat (limited to 'servers/visual')
-rw-r--r--servers/visual/rasterizer.h1
-rw-r--r--servers/visual/visual_server_raster.cpp10
2 files changed, 8 insertions, 3 deletions
diff --git a/servers/visual/rasterizer.h b/servers/visual/rasterizer.h
index f0a67e8442..81862fb3a6 100644
--- a/servers/visual/rasterizer.h
+++ b/servers/visual/rasterizer.h
@@ -661,6 +661,7 @@ public:
};
Type type;
+ virtual ~Command(){}
};
struct CommandLine : public Command {
diff --git a/servers/visual/visual_server_raster.cpp b/servers/visual/visual_server_raster.cpp
index eaa02df516..2417c02bf8 100644
--- a/servers/visual/visual_server_raster.cpp
+++ b/servers/visual/visual_server_raster.cpp
@@ -4393,7 +4393,7 @@ void VisualServerRaster::free( RID p_rid ) {
VS_CHANGED;
- if (rasterizer->is_texture(p_rid) || rasterizer->is_material(p_rid) || rasterizer->is_shader(p_rid)) {
+ if (rasterizer->is_texture(p_rid) || rasterizer->is_material(p_rid) || rasterizer->is_shader(p_rid) || rasterizer->is_environment(p_rid)) {
rasterizer->free(p_rid);
} else if (rasterizer->is_skeleton(p_rid)) {
@@ -4410,7 +4410,7 @@ void VisualServerRaster::free( RID p_rid ) {
}
rasterizer->free(p_rid);
- } else if (rasterizer->is_mesh(p_rid) || rasterizer->is_multimesh(p_rid) || rasterizer->is_light(p_rid) || rasterizer->is_particles(p_rid) ) {
+ } else if (rasterizer->is_mesh(p_rid) || rasterizer->is_multimesh(p_rid) || rasterizer->is_light(p_rid) || rasterizer->is_particles(p_rid) || rasterizer->is_immediate(p_rid)) {
//delete the resource
_free_attached_instances(p_rid);
@@ -7488,6 +7488,10 @@ void VisualServerRaster::finish() {
free(default_cursor_texture);
+ if (test_cube.is_valid())
+ free(test_cube);
+
+ _free_internal_rids();
_clean_up_owner( &room_owner,"Room" );
_clean_up_owner( &portal_owner,"Portal" );
@@ -7505,7 +7509,7 @@ void VisualServerRaster::finish() {
octree_allocator.clear();
if (instance_dependency_map.size()) {
- print_line("base resources missing "+itos(instance_dependency_map.size()));
+ print_line("Base resources missing amount: "+itos(instance_dependency_map.size()));
}
ERR_FAIL_COND( instance_dependency_map.size() );
}