Go to file
Nat Goodspeed 95a218fcc0 DRTVWR-476: Eliminate static LLEventPump factory maps.
Having a map from std::string to a factory function returning LLEventPump* is
a cool idea, especially since you could statically populate such a map with
string literals and little lambdas.

Unfortunately, static initialization of any data is a bad idea when control
can reach consuming code before that module's static data are constructed.

Since LLEventPumps is already an LLSingleton, it's simple enough to make its
map non-static and initialize it in the constructor.

But another recent static factory-function map was introduced in
llleaplistener.cpp to support the LLLeapListener::newpump() operation. That
involves no LLSingletons.

Introduce LLEventPumps::make(name, tweak, type) to instantiate an LLEventPump
subclass of the specified type with specified (name, tweak) parameters.
Instances returned by make() are owned by LLEventPumps, as with obtain().
Introduce LLEventPumps::BadType exception for when the type string isn't
recognized.

LLEventPumps::obtain() can then simply call make() when the specified instance
name doesn't already exist. The configuration data used internally by obtain()
becomes { string instance name, string subclass name }. Although this too is
currently initialized in the LLEventPumps constructor, migrating it to a
configuration file would now be far more straightforward than before.

LLLeapListener::newpump(), too, can call LLEventPumps::make() with the
caller-specified type string. This eliminates that static factory map.
newpump() must catch BadType and report the error back to its invoker.

Given that the LLEventPump subclass instances returned by make() are owned by
LLEventPumps rather than LLLeapListener, there is no further need for the
LLLeapListener::mEventPumps ptr_map, which was used only to manage lifetime.
Also remove LLLeapListener's "killpump" operation since LLEventPumps provides
no corresponding functionality.
2020-03-25 18:58:16 -04:00
debian
…
doc Merged in lindenlab/viewer-lynx 2019-06-22 03:17:43 +03:00
etc
…
indra DRTVWR-476: Eliminate static LLEventPump factory maps. 2020-03-25 18:58:16 -04:00
scripts
…
.clang-format Convert ignore file to git, add a .clang-format rules file 2020-01-10 16:27:33 -07:00
.gitignore Ignore build-vc150-* directories as those are the VS2017 build dirs (n.b. due to the rather strange version numbering of VS this really should be build-vc141-*; as VS2017 is vc141 internally). 2020-03-25 18:44:04 -04:00
.hgtags Added tag 6.3.5-release for changeset 27ca5834bfe9 2019-12-12 13:15:52 -05:00
BuildParams
…
README.md
…
autobuild.xml DRTVWR-476: Update to viewer-manager build 531762 2020-03-25 18:52:10 -04:00
build.sh [DRTVWR-476] - disable dbghelp.h warnings 2020-03-25 18:39:20 -04:00

README.md

Second Life Viewer

This project manages the source code for the Second Life Viewer.

This source is available as open source; for details on licensing, see the licensing page on the Second Life wiki

For information on how to use and contribute to this, see the open source portal on the wiki.

To download the current default version, visit the download page. For even newer versions try the Alternate Viewers page