When e segfaults during startup (module load), e now disables that module correctly after a restart and tells the user about that. TODO: Disable all modules correctly when not sure which one did the segfault during startup...

SVN revision: 48332
This commit is contained in:
Miculcy Brian 2010-04-26 16:31:33 +00:00
parent 56259ca821
commit b7c95b0a13
2 changed files with 55 additions and 20 deletions

View File

@ -1010,27 +1010,54 @@ main(int argc, char **argv)
/* load modules */
e_init_status_set(_("Load Modules"));
TS("load modules");
if (!safe_mode)
e_module_all_load();
else
if (safe_mode)
{
e_int_config_modules(e_container_current_get(e_manager_current_get()), NULL);
e_error_message_show
(_("Enlightenment crashed early on start and has<br>"
"been restarted. All modules have been disabled<br>"
"and will not be loaded to help remove any problem<br>"
"modules from your configuration. The module<br>"
"configuration dialog should let you select your<br>"
"modules again."));
e_util_dialog_show
(_("Enlightenment crashed early on start and has been restarted"),
_("Enlightenment crashed early on start and has been restarted.<br>"
"All modules have been disabled and will not be loaded to help<br>"
"remove any problem modules from your configuration.<br><br>"
"The module configuration dialog should let you select your<br>"
"modules again."));
e_config_save_queue();
E_Module *m;
char *crashmodule;
crashmodule = getenv("E_MODULE_LOAD");
if (crashmodule) m = e_module_new(crashmodule);
if (crashmodule && m)
{
e_module_disable(m);
e_object_del(E_OBJECT(m));
e_config_save_queue();
e_int_config_modules(e_container_current_get(e_manager_current_get()), NULL);
e_error_message_show
(_("Enlightenment crashed early on start and has<br>"
"been restarted. There was an error loading<br>"
"module named: %s. This module has been disabled<br>"
"and will not be loaded."), crashmodule);
e_util_dialog_show
(_("Enlightenment crashed early on start and has been restarted"),
_("Enlightenment crashed early on start and has been restarted.<br>"
"There was an error loading module named: %s<br><br>"
"This module has been disabled and will not be loaded."), crashmodule);
e_module_all_load();
}
else
{
e_int_config_modules(e_container_current_get(e_manager_current_get()), NULL);
e_error_message_show
(_("Enlightenment crashed early on start and has<br>"
"been restarted. All modules have been disabled<br>"
"and will not be loaded to help remove any problem<br>"
"modules from your configuration. The module<br>"
"configuration dialog should let you select your<br>"
"modules again."));
e_util_dialog_show
(_("Enlightenment crashed early on start and has been restarted"),
_("Enlightenment crashed early on start and has been restarted.<br>"
"All modules have been disabled and will not be loaded to help<br>"
"remove any problem modules from your configuration.<br><br>"
"The module configuration dialog should let you select your<br>"
"modules again."));
}
}
else
e_module_all_load();
TS("init properites");
if (!nostartup)

View File

@ -69,6 +69,7 @@ e_module_all_load(void)
{
Eina_List *l;
E_Config_Module *em;
char buf[128];
e_config->modules = eina_list_sort(e_config->modules,
eina_list_count(e_config->modules),
@ -89,7 +90,13 @@ e_module_all_load(void)
else if (em->enabled)
{
m = NULL;
if (em->name) m = e_module_new(em->name);
if (!em->name) continue;
setenv("E_MODULE_LOAD", em->name, 1);
snprintf (buf, sizeof(buf), _("Loading Module: %s"), em->name);
e_init_status_set(em->name);
m = e_module_new(em->name);
if (m) e_module_enable(m);
}
}
@ -98,6 +105,7 @@ e_module_all_load(void)
{
ecore_event_add(E_EVENT_MODULE_INIT_END, NULL, NULL, NULL);
}
unsetenv("E_MODULE_LOAD");
}
EAPI E_Module *