From: Pekka Paalanen Date: Mon, 4 Nov 2019 12:07:51 +0000 (+0200) Subject: compositor: allow double-loading modules X-Git-Tag: upstream/9.0.0~262 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=3025353e8314dfed1b38d2e3f4164a7af1362033;p=platform%2Fupstream%2Fweston.git compositor: allow double-loading modules This is necessary for the test harness to be able to execute the compositor multiple times in the same process. As we never unload opened modules, the first compositor iteration will leave them all loaded and following compositor iterations will then have them already loaded. Signed-off-by: Pekka Paalanen --- diff --git a/compositor/main.c b/compositor/main.c index 22ac8b23..07ec9316 100644 --- a/compositor/main.c +++ b/compositor/main.c @@ -865,15 +865,13 @@ wet_load_module_entrypoint(const char *name, const char *entrypoint) module = dlopen(path, RTLD_NOW | RTLD_NOLOAD); if (module) { weston_log("Module '%s' already loaded\n", path); - dlclose(module); - return NULL; - } - - weston_log("Loading module '%s'\n", path); - module = dlopen(path, RTLD_NOW); - if (!module) { - weston_log("Failed to load module: %s\n", dlerror()); - return NULL; + } else { + weston_log("Loading module '%s'\n", path); + module = dlopen(path, RTLD_NOW); + if (!module) { + weston_log("Failed to load module: %s\n", dlerror()); + return NULL; + } } init = dlsym(module, entrypoint);