rem: if (global_session_deleted == false) { global_session_deleted = true; if (global_pointer_to_ecaparams != 0) delete global_pointer_to_ecaparams; } exit(0);
add: clean_exit(0);
context: void signal_handler(int signum) {  cerr << "Caught a signal... cleaning up.\n";  if (global_session_deleted == false) {    global_session_deleted = true;    if (global_pointer_to_ecaparams != 0) delete global_pointer_to_ecaparams;  }  exit(0);}