X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;ds=inline;f=openbox%2Fengine.c;h=66d305805a155c48f137a4e6c1c5321899edfb8d;hb=f278ec41e4c310da218563e7d443df32783e26e4;hp=34d7291801aa105be3a3d00ea80e606ad5452be6;hpb=6016ff8658c53fca30b1ee530bea9c469f2cce84;p=chaz%2Fopenbox diff --git a/openbox/engine.c b/openbox/engine.c index 34d72918..66d30580 100644 --- a/openbox/engine.c +++ b/openbox/engine.c @@ -46,19 +46,21 @@ static gboolean load(char *name) g_assert(module == NULL); - path = g_build_filename(ENGINEDIR, name, NULL); + path = g_build_filename(g_get_home_dir(), ".openbox", "engines", name, + NULL); module = g_module_open(path, 0); g_free(path); if (module == NULL) { - path = g_build_filename(g_get_home_dir(), ".openbox", "engines", name, - NULL); - module = g_module_open(path, 0); - g_free(path); + path = g_build_filename(ENGINEDIR, name, NULL); + module = g_module_open(path, 0); + g_free(path); } - if (module == NULL) + if (module == NULL) { + g_warning(g_module_error()); return FALSE; + } /* load the engine's symbols */ LOADSYM(startup, estartup); @@ -159,6 +161,10 @@ void engine_load() return; g_warning("Failed to load the engine '%s'", engine_name); g_message("Falling back to the default: '%s'", DEFAULT_ENGINE); + if (module != NULL) { + g_module_close(module); + module = NULL; + } if (!load(DEFAULT_ENGINE)) { g_critical("Failed to load the engine '%s'. Aborting", DEFAULT_ENGINE); exit(1);