+
+ if (nedsim->nedstate != NULL) {
+ free(nedsim->nedstate->active_thread->psw);
+ free(nedsim->nedstate->active_thread);
+ free(nedsim->nedstate->hack);
+ free(nedsim->nedstate);
+ }
+
+ // TODO: Replace all this with proper code to free everything related to the screensaver itself.