[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Gnash-dev] SharedLib API wooes

From: Sandro Santilli
Subject: [Gnash-dev] SharedLib API wooes
Date: Fri, 12 Aug 2011 16:55:49 +0200
User-agent: Mutt/1.5.20 (2009-06-14)

This warning made me take a look:

 libbase/sharedlib.cpp:65: warning: unused parameter ‘envvar’

What I've found is that SharedLib can be constructed in two ways:

 SharedLib(const std::string& filespec);
 DSOEXPORT SharedLib(const std::string& filespec, const std::string& envvar);

Note that someone added a DSOEXPORT on the second signature, probably
because it was found to be needed. 
Users of the constructors are:

./cygnal/handler.cpp:        sl = new SharedLib(module, "CYGNAL_PLUGINS");
./libbase/extension.cpp:        sl = new SharedLib(_pluginsdir + "/" + module, 
./libbase/extension.cpp:        sl = new SharedLib(module);

Note that one function in extensions uses the signature w/out envvar.

It's interesting (?) that the version with 'envvar' parameter tries
to initialize libltdl, while the other doesn't.

Here's the full code:

  SharedLib::SharedLib(const std::string& filespec)
      _filespec = filespec;
  SharedLib::SharedLib(const std::string& filespec, const std::string& envvar)
      _filespec = filespec;
      scoped_lock lock(_libMutex);
      // Initialize libtool's dynamic library loader
  #ifdef HAVE_LTDL
      int errors = lt_dlinit ();
      if (errors) {
          log_error (_("Couldn't initialize ltdl: %s"), lt_dlerror());
  # warning "libltdl not enabled in build".

So, does anyone have an idea about whether lt_dlinit should be called
always on SharedLib constructor or never or doesn't matter ?
And, as a consequence, if we can get rid of one of the two constructors
completely ?

IIRC a file was filed recently about LD_PRELOAD segfaulting somewhere
around extensions loading (which this piece of code should be triggered by)
so it'd be nice to reduce some noise in there.


  ()   Free GIS & Flash consultant/developer

reply via email to

[Prev in Thread] Current Thread [Next in Thread]