[opensource-dev] LLSingleton class question.

lists.secondlife.com at trap.wereanimal.net lists.secondlife.com at trap.wereanimal.net
Sat Nov 19 20:48:05 PST 2011


Hi all.

In the LLSingleton header, there is a comment:

// Reference version of getInstance()
// Preferred over getInstance() as it disallows checking for NULL

My question is, is there a difference between
MyClass::instance()->someFunction(); and
MyClass::getInstance()->someFunction(); ?

If not, is there a preference of using one over the other?

Linden Lab viewer code has about 35% ::instance use vs.
65% ::getInstance use.

-- Techwolf Lupindo


More information about the opensource-dev mailing list