#if defined(NDEBUG_STUBS)
return false;
#else
- return Target::get().dump(scope);
+ return Target::get().dumping(scope);
#endif
}
sink->dump(buffer);
}
-bool Target::dump(const char *scope)
+bool Target::dumping(const char *scope)
{
return dumpSelector(scope);
}
if (singleton == NULL) {
Target *t = new Target;
t->setFromEnvironment();
+
+ // The Target constructor attempts to set singleton to the object. If it didn't succeed, we don't need T anymore.
+ if(singleton != t) {
+ delete t;
+ }
}
return *singleton;
}