mirror of
https://gitlab.freedesktop.org/wayland/weston
synced 2024-09-06 09:56:14 +00:00
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 <pekka.paalanen@collabora.com>
This commit is contained in:
parent
f696ee9337
commit
3025353e83
|
@ -865,16 +865,14 @@ 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;
|
||||
}
|
||||
|
||||
} 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);
|
||||
if (!init) {
|
||||
|
|
Loading…
Reference in a new issue