diff options
author | Nat Goodspeed <nat@lindenlab.com> | 2019-08-20 12:36:06 -0400 |
---|---|---|
committer | Nat Goodspeed <nat@lindenlab.com> | 2019-08-20 12:36:06 -0400 |
commit | 54b98cb8c1302a1da5779d8968e54e5be641e644 (patch) | |
tree | 4fb8ebf2dcd72671e7e3c84b3ccd4e970bb360c4 /indra/tools/vstool/README.txt | |
parent | 310db14beefc29ee72e0d13f0cb63cb2958ebf68 (diff) |
DRTVWR-493: Defend LL[Param]Singleton against ctor/init exceptions.
An exception in the LLSingleton subclass constructor, or in its
initSingleton() method, could leave the LLSingleton machinery in a bad state:
the failing instance would remain in the MasterList, also on the stack of
initializing LLSingletons. Catch exceptions in either and perform relevant
cleanup.
This problem is highlighted by test programs, in which LL_ERRS throws an
exception rather than crashing the whole process.
In the relevant catch clauses, clean up the initializing stack BEFORE logging.
Otherwise we get tangled up recording bogus dependencies.
Move capture_dependency() out of finishInitializing(): it must be called by
every valid getInstance() call, both from LLSingleton and LLParamSingleton.
Introduce new CONSTRUCTED EInitState value to distinguish "have called the
constructor but not yet the initSingleton() method" from "currently within
initSingleton() method." This is transient, but we execute the 'switch' on
state within that moment. One could argue that the previous enum used
INITIALIZING for current CONSTRUCTED, and INITIALIZED meant INITIALIZING too,
but this is clearer.
Introduce template LLSingletonBase::classname() helper methods to clarify
verbose demangle(typeid(stuff).name()) calls.
Similarly, introduce LLSingleton::pop_initializing() shorthand method.
Diffstat (limited to 'indra/tools/vstool/README.txt')
0 files changed, 0 insertions, 0 deletions