diff --git a/Buildings/Resources/C-Sources/cfdSendStopCommand.c b/Buildings/Resources/C-Sources/cfdSendStopCommand.c index 93cf78653b1..77bf3d3b9bf 100644 --- a/Buildings/Resources/C-Sources/cfdSendStopCommand.c +++ b/Buildings/Resources/C-Sources/cfdSendStopCommand.c @@ -149,6 +149,9 @@ void cfdSendStopCommand(void *thread) { } if (cosim != NULL){ free(cosim); + /* If it is not explicitly set to NULL - then the check in cfdcosim() + will fail if a second simulation is performed. */ + cosim = NULL; } } /* End of cfdSendStopCommand*/