Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2020-02-17 08:04:04 +0300
committerCampbell Barton <ideasman42@gmail.com>2020-02-17 08:04:04 +0300
commit60890ccf9d33f5729e78d92aa1125916260e19e0 (patch)
tree9993ed4097f158b3d2c69dace232258a44286bde /intern/mantaflow
parent2ff1d62b876f7f06cda5690cc4b8ec0710bad887 (diff)
Fix T73862: Fluid Sim file handle resource leak
Diffstat (limited to 'intern/mantaflow')
-rw-r--r--intern/mantaflow/intern/MANTA_main.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/intern/mantaflow/intern/MANTA_main.cpp b/intern/mantaflow/intern/MANTA_main.cpp
index d7c8f5491a9..a78bb9f7719 100644
--- a/intern/mantaflow/intern/MANTA_main.cpp
+++ b/intern/mantaflow/intern/MANTA_main.cpp
@@ -2634,6 +2634,7 @@ void MANTA::updateMeshFromUni(const char *filename)
if (!ibuffer[0]) { // Any vertices present?
if (with_debug)
std::cout << "no vertices present yet" << std::endl;
+ gzclose(gzf);
return;
}
@@ -2701,6 +2702,7 @@ void MANTA::updateParticlesFromUni(const char *filename, bool isSecondarySys, bo
if (!strcmp(ID, "PB01")) {
std::cout << "particle uni file format v01 not supported anymore" << std::endl;
+ gzclose(gzf);
return;
}
@@ -2743,6 +2745,7 @@ void MANTA::updateParticlesFromUni(const char *filename, bool isSecondarySys, bo
if (!ibuffer[0]) { // Any particles present?
if (with_debug)
std::cout << "no particles present yet" << std::endl;
+ gzclose(gzf);
return;
}
@@ -2845,16 +2848,19 @@ int MANTA::updateGridFromUni(const char *filename, float *grid, bool isNoise)
if (!strcmp(ID, "DDF2")) {
std::cout << "MANTA::updateGridFromUni(): grid uni file format DDF2 not supported anymore"
<< std::endl;
+ gzclose(gzf);
return 0;
}
if (!strcmp(ID, "MNT1")) {
std::cout << "MANTA::updateGridFromUni(): grid uni file format MNT1 not supported anymore"
<< std::endl;
+ gzclose(gzf);
return 0;
}
if (!strcmp(ID, "MNT2")) {
std::cout << "MANTA::updateGridFromUni(): grid uni file format MNT2 not supported anymore"
<< std::endl;
+ gzclose(gzf);
return 0;
}
@@ -2885,6 +2891,7 @@ int MANTA::updateGridFromUni(const char *filename, float *grid, bool isNoise)
std::cout << "grid dim doesn't match, read: (" << ibuffer[0] << ", " << ibuffer[1] << ", "
<< ibuffer[2] << ") vs setup: (" << resX << ", " << resY << ", " << resZ << ")"
<< std::endl;
+ gzclose(gzf);
return 0;
}