UI: IocContainer: Don't delete TlsIndex.

Several unit tests can run in parallel.
This commit is contained in:
Nodir Temirkhodjaev 2021-06-03 17:24:19 +03:00
parent 121619a939
commit 4a75936f97
2 changed files with 4 additions and 2 deletions

View File

@ -88,8 +88,10 @@ TEST_F(IocContainerTest, insert)
container.setService<IocTest::B>(b);
ASSERT_EQ(container.resolve<IocTest::A>(), a2);
ASSERT_EQ(container.resolve<IocTest::B>(), &b);
ASSERT_TRUE(container.pinToThread());
ASSERT_EQ(IoC<IocTest::A>(), a2);
ASSERT_EQ(IoC<IocTest::B>(), &b);
}
TEST_F(IocContainerTest, setUp)

View File

@ -22,6 +22,7 @@ void createTlsIndex()
}
}
#if 0
void deleteTlsIndex()
{
if (g_tlsIndex != -1) {
@ -29,6 +30,7 @@ void deleteTlsIndex()
g_tlsIndex = -1;
}
}
#endif
}
@ -37,8 +39,6 @@ IocContainer::IocContainer(QObject *parent) : QObject(parent) { }
IocContainer::~IocContainer()
{
autoDeleteAll();
deleteTlsIndex();
}
void IocContainer::setObject(int typeId, IocObject *obj, quint8 flags)