YUI::ui() calls YUI::ensureUICreated() calls YUILoader::loadUI calls YUILoader::loadPlugin. That instantiates YUIPlugin(string plugin_name) and calls its YUIPlugin::locateSymbol "_Z8createUIb" (mangled createUI(bool) ) to produce a YUI * (* createUIFunction_t)(bool withThreads) which is called. Its result is discarded, but YUI::_ui gets initialized by the YUI::YUI ctor called by the derived ctor.
YUIPlugin calls dlopen, but dlclose is not called by default, and actually proably never.