[Bf-blender-cvs] [45369cb1f0c] fluid-mantaflow: added cleanup routine in destructor for multigrid

Sebastián Barschkis noreply at git.blender.org
Sat May 27 22:53:53 CEST 2017


Commit: 45369cb1f0c52c389302d186323114a134c09c7a
Author: Sebastián Barschkis
Date:   Mon Apr 3 01:03:33 2017 +0200
Branches: fluid-mantaflow
https://developer.blender.org/rB45369cb1f0c52c389302d186323114a134c09c7a

added cleanup routine in destructor for multigrid

===================================================================

M	intern/mantaflow/intern/FLUID.cpp
M	intern/mantaflow/intern/strings/shared_script.h

===================================================================

diff --git a/intern/mantaflow/intern/FLUID.cpp b/intern/mantaflow/intern/FLUID.cpp
index 37d4fcf9fa6..e4ece416b07 100644
--- a/intern/mantaflow/intern/FLUID.cpp
+++ b/intern/mantaflow/intern/FLUID.cpp
@@ -400,7 +400,11 @@ FLUID::~FLUID()
 	tmpString += smoke_delete_grids_high;
 	tmpString += smoke_delete_fire_high;
 	tmpString += smoke_delete_colors_high;
-	
+
+	// Cleanup multigrid
+	tmpString += fluid_multigrid_cleanup_low;
+	if (mUsingHighRes) tmpString += fluid_multigrid_cleanup_high;
+
 	// Make sure that everything is garbage collected
 	tmpString += gc_collect;
 
diff --git a/intern/mantaflow/intern/strings/shared_script.h b/intern/mantaflow/intern/strings/shared_script.h
index 7e03c1464c1..77775df6a91 100644
--- a/intern/mantaflow/intern/strings/shared_script.h
+++ b/intern/mantaflow/intern/strings/shared_script.h
@@ -133,6 +133,14 @@ const std::string fluid_delete_solver_high = "\n\
 mantaMsg('Deleting solver high')\n\
 if 'xl$ID$' in globals() : del xl$ID$\n";
 
+const std::string fluid_multigrid_cleanup_low = "\n\
+mantaMsg('Cleanup multigrid low')\n\
+releaseMG(s$ID$)\n";
+
+const std::string fluid_multigrid_cleanup_high = "\n\
+mantaMsg('Cleanup multigrid high')\n\
+releaseMG(xl$ID$)\n";
+
 const std::string gc_collect = "\n\
 gc.collect()\n";




More information about the Bf-blender-cvs mailing list