This function stops a currently active gagdet simulation and release all the allocated memory.

endGadget()