sb121: #i110006# do not leak Component singleton (based on a patch by cmc)

This commit is contained in:
sb 2010-03-11 13:31:37 +01:00
parent 086029a4c9
commit ecbebd83b2

View file

@ -112,7 +112,7 @@ rtl::OUString expand(rtl::OUString const & str) {
}
static bool singletonCreated = false;
static Components * singleton; // leaks
static Components * singleton = 0;
}
@ -122,7 +122,8 @@ void Components::initSingleton(
OSL_ASSERT(context.is());
if (!singletonCreated) {
singletonCreated = true;
singleton = new Components(context);
static Components theSingleton(context);
singleton = &theSingleton;
}
}