Clearing the end of simulation segfault, by removing the de-allocation
that
uses the callback freeMemory.