Fix T36769: fluid sim modifier can crash blender

Crash only happened when the number of openmp threads were greater than the resolution.
This commit is contained in:
Daniel Genrich 2014-02-05 15:30:10 +01:00
parent 6213d88c85
commit 1ab86e3f1f
Notes: blender-bot 2023-02-14 11:50:34 +01:00
Referenced by issue #36769, fluid sim modifier can crash blender
1 changed files with 9 additions and 0 deletions

View File

@ -799,6 +799,15 @@ bool LbmFsgrSolver::initializeSolverMemory()
mLevel[i].avgOmegaCnt = 0.0;
}
/*
// DG: this would be the correct sanity check, not the "hack below" */
// if(( mSizey / mNumOMPThreads) * mNumOMPThreads != mSizey) {
// setNumOMPThreads();
//}
if( mSizey < mNumOMPThreads ) {
setNumOMPThreads(mSizey);
}
// init sizes
mLevel[mMaxRefine].lSizex = mSizex;
mLevel[mMaxRefine].lSizey = mSizey;