Commit 9a245d12 authored by Peter Eastman's avatar Peter Eastman
Browse files

Fixed crash when calling setGlobalVariable() before a Context is created

parent b69f0c15
...@@ -122,7 +122,8 @@ void CustomIntegrator::setGlobalVariable(int index, double value) { ...@@ -122,7 +122,8 @@ void CustomIntegrator::setGlobalVariable(int index, double value) {
globalsAreCurrent = true; globalsAreCurrent = true;
} }
globalValues[index] = value; globalValues[index] = value;
dynamic_cast<IntegrateCustomStepKernel&>(kernel.getImpl()).setGlobalVariables(*context, globalValues); if (owner != NULL)
dynamic_cast<IntegrateCustomStepKernel&>(kernel.getImpl()).setGlobalVariables(*context, globalValues);
} }
void CustomIntegrator::setGlobalVariableByName(const string& name, double value) { void CustomIntegrator::setGlobalVariableByName(const string& name, double value) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment