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);
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);