Avoided heap fragmentation due to driver reload by explicitly unloading the old driver (if applicable) instead of relying on the service replace infrastructure.
diff --git a/contiki-apple2/apps/configedit.c b/contiki-apple2/apps/configedit.c
index 1dc27c8..619167a 100644
--- a/contiki-apple2/apps/configedit.c
+++ b/contiki-apple2/apps/configedit.c
@@ -32,7 +32,7 @@
*
* This file is part of the Contiki desktop environment
*
- * $Id: configedit.c,v 1.2 2005/01/26 21:33:29 oliverschmidt Exp $
+ * $Id: configedit.c,v 1.3 2005/02/01 00:21:36 oliverschmidt Exp $
*
*/
@@ -125,6 +125,7 @@
EK_PROCESS(p, "Configuration", EK_PRIO_NORMAL,
config_eventhandler, NULL, NULL);
static ek_id_t id = EK_ID_NONE;
+static ek_id_t driverid = EK_ID_NONE;
/*-----------------------------------------------------------------------------------*/
LOADER_INIT_FUNC(config_init, arg)
@@ -200,6 +201,7 @@
for(p = EK_PROCS(); p != NULL; p = p->next) {
if(makedriver(p->name, driver)) {
+ driverid = p->id;
break;
}
}
@@ -299,6 +301,10 @@
#endif /* __APPLE2ENH__ */
+ if(driverid != EK_ID_NONE) {
+ ek_post(driverid, EK_EVENT_REQUEST_EXIT, NULL);
+ }
+
config_setlanslot(config.slot);
if(*config.driver) {