Commit 03f93cf0 by Mingyu Hu Committed by Commit Bot

ANGLE test fixture leaking.

Adding code in ANGLETestEnvironment::TearDown() to release fixtures if exists. Bug: angleproject:3875 Change-Id: I0d6ad9b8c72937b20a4c3033b86eb667b546e0c3 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1778841Reviewed-by: 's avatarRafael Cintron <rafael.cintron@microsoft.com> Reviewed-by: 's avatarJamie Madill <jmadill@chromium.org> Commit-Queue: Rafael Cintron <rafael.cintron@microsoft.com>
parent 43766003
...@@ -628,6 +628,17 @@ void ANGLETestBase::ANGLETestTearDown() ...@@ -628,6 +628,17 @@ void ANGLETestBase::ANGLETestTearDown()
} }
} }
void ANGLETestBase::ReleaseFixtures()
{
for (auto it = gFixtures.begin(); it != gFixtures.end(); it++)
{
if (it->second.eglWindow)
{
it->second.eglWindow->destroyGL();
}
}
}
void ANGLETestBase::swapBuffers() void ANGLETestBase::swapBuffers()
{ {
if (getGLWindow()->isGLInitialized()) if (getGLWindow()->isGLInitialized())
...@@ -1325,7 +1336,10 @@ std::unique_ptr<Library> ANGLETestEnvironment::gWGLLibrary; ...@@ -1325,7 +1336,10 @@ std::unique_ptr<Library> ANGLETestEnvironment::gWGLLibrary;
void ANGLETestEnvironment::SetUp() {} void ANGLETestEnvironment::SetUp() {}
void ANGLETestEnvironment::TearDown() {} void ANGLETestEnvironment::TearDown()
{
ANGLETestBase::ReleaseFixtures();
}
Library *ANGLETestEnvironment::GetEGLLibrary() Library *ANGLETestEnvironment::GetEGLLibrary()
{ {
......
...@@ -290,6 +290,8 @@ class ANGLETestBase ...@@ -290,6 +290,8 @@ class ANGLETestBase
virtual void overrideWorkaroundsD3D(angle::FeaturesD3D *featuresD3D) {} virtual void overrideWorkaroundsD3D(angle::FeaturesD3D *featuresD3D) {}
virtual void overrideFeaturesVk(angle::FeaturesVk *featuresVulkan) {} virtual void overrideFeaturesVk(angle::FeaturesVk *featuresVulkan) {}
static void ReleaseFixtures();
protected: protected:
void ANGLETestSetUp(); void ANGLETestSetUp();
void ANGLETestTearDown(); void ANGLETestTearDown();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment