mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-03 10:22:45 -04:00
only try to load a given module once
This commit is contained in:
parent
fa59c3e37f
commit
bdbb17a084
@ -19,10 +19,11 @@
|
|||||||
#include "graphicsPipe.h"
|
#include "graphicsPipe.h"
|
||||||
#include "config_display.h"
|
#include "config_display.h"
|
||||||
|
|
||||||
#include <algorithm>
|
#include "load_dso.h"
|
||||||
|
#include "filename.h"
|
||||||
|
#include "pset.h"
|
||||||
|
|
||||||
#include <load_dso.h>
|
#include <algorithm>
|
||||||
#include <filename.h>
|
|
||||||
|
|
||||||
// Static variables
|
// Static variables
|
||||||
////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////
|
||||||
@ -340,24 +341,34 @@ get_factory() {
|
|||||||
void GraphicsPipe::resolve_modules(void) {
|
void GraphicsPipe::resolve_modules(void) {
|
||||||
Config::ConfigTable::Symbol::iterator i;
|
Config::ConfigTable::Symbol::iterator i;
|
||||||
|
|
||||||
|
// Build up a set of the modules we've already loaded as we go, so
|
||||||
|
// we don't attempt to load a given module more than once.
|
||||||
|
pset<string> already_loaded;
|
||||||
|
|
||||||
for (i=pipe_modules_begin(); i!=pipe_modules_end(); ++i) {
|
for (i=pipe_modules_begin(); i!=pipe_modules_end(); ++i) {
|
||||||
Filename dlname = Filename::dso_filename("lib" + (*i).Val() + ".so");
|
string name = (*i).Val();
|
||||||
display_cat.info()
|
if (already_loaded.insert(name).second) {
|
||||||
<< "loading display module: " << dlname.to_os_specific() << endl;
|
Filename dlname = Filename::dso_filename("lib" + name + ".so");
|
||||||
void *tmp = load_dso(dlname);
|
|
||||||
if (tmp == (void*)0L) {
|
|
||||||
display_cat.info()
|
display_cat.info()
|
||||||
<< "Unable to load: " << load_dso_error() << endl;
|
<< "loading display module: " << dlname.to_os_specific() << endl;
|
||||||
|
void *tmp = load_dso(dlname);
|
||||||
|
if (tmp == (void*)0L) {
|
||||||
|
display_cat.info()
|
||||||
|
<< "Unable to load: " << load_dso_error() << endl;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
for (i=gsg_modules_begin(); i!=gsg_modules_end(); ++i) {
|
for (i=gsg_modules_begin(); i!=gsg_modules_end(); ++i) {
|
||||||
Filename dlname = Filename::dso_filename("lib" + (*i).Val() + ".so");
|
string name = (*i).Val();
|
||||||
display_cat.info()
|
if (already_loaded.insert(name).second) {
|
||||||
<< "loading GSG module: " << dlname.to_os_specific() << endl;
|
Filename dlname = Filename::dso_filename("lib" + name + ".so");
|
||||||
void *tmp = load_dso(dlname);
|
|
||||||
if (tmp == (void*)0L) {
|
|
||||||
display_cat.info()
|
display_cat.info()
|
||||||
<< "Unable to load: " << load_dso_error() << endl;
|
<< "loading GSG module: " << dlname.to_os_specific() << endl;
|
||||||
|
void *tmp = load_dso(dlname);
|
||||||
|
if (tmp == (void*)0L) {
|
||||||
|
display_cat.info()
|
||||||
|
<< "Unable to load: " << load_dso_error() << endl;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user