    Tidy up the invisible application shell created at startup

diff -U5 -r nedit_official nedit_mod
diff -U5 -r nedit_official/source/nedit.c nedit_mod/source/nedit.c
--- nedit_official/source/nedit.c	2007-11-29 23:18:09.000000000 +0100
+++ nedit_mod/source/nedit.c	2008-05-21 02:34:02.000000000 +0200
@@ -103,10 +103,11 @@
 static int sortAlphabetical(const void* k1, const void* k2);
 static int virtKeyBindingsAreInvalid(const unsigned char* bindings);
 static void restoreInsaneVirtualKeyBindings(unsigned char* bindings);
 static void noWarningFilter(String);
 static void showWarningFilter(String);
+static void deleteAppShell();
 
 WindowInfo *WindowList = NULL;
 Display *TheDisplay = NULL;
 char *ArgV0 = NULL;
 Boolean IsServer = False;
@@ -506,11 +507,12 @@
                                          APP_CLASS,
                                          applicationShellWidgetClass,
                                          TheDisplay,
                                          NULL,
                                          0);
-    
+    atexit(deleteAppShell);
+
     /* Restore the original bindings ASAP such that other apps are not affected. */
     restoreInsaneVirtualKeyBindings(invalidBindings);
 
     XtSetMappedWhenManaged(TheAppShell, False);
     XtRealizeWidget(TheAppShell);
@@ -1308,5 +1310,10 @@
 
 static void noWarningFilter(String message)
 {
   return;
 }
+
+static void deleteAppShell()
+{
+    XtDestroyWidget(TheAppShell);
+}
