Commit 41ae31c4 by Geoff Lang

Destroy surfaces from Display::terminate instead of the DisplayImpl destructor.

Previously, the parent display impl would be destroyed before the surface impls. It is useful to call helper functions in the parent display during surface destruction. BUG=540829 Change-Id: I0884826d2e360319da896f049d46bfc01a2481a0 Reviewed-on: https://chromium-review.googlesource.com/316801Reviewed-by: 's avatarCorentin Wallez <cwallez@chromium.org> Reviewed-by: 's avatarJamie Madill <jmadill@chromium.org> Tested-by: 's avatarGeoff Lang <geofflang@chromium.org>
parent 1b3979b9
...@@ -420,6 +420,11 @@ void Display::terminate() ...@@ -420,6 +420,11 @@ void Display::terminate()
destroyImage(*mImageSet.begin()); destroyImage(*mImageSet.begin());
} }
while (!mImplementation->getSurfaceSet().empty())
{
destroySurface(*mImplementation->getSurfaceSet().begin());
}
mConfigSet.clear(); mConfigSet.clear();
if (mDevice != nullptr && mDevice->getOwningDisplay() != nullptr) if (mDevice != nullptr && mDevice->getOwningDisplay() != nullptr)
......
...@@ -21,10 +21,7 @@ DisplayImpl::DisplayImpl() ...@@ -21,10 +21,7 @@ DisplayImpl::DisplayImpl()
DisplayImpl::~DisplayImpl() DisplayImpl::~DisplayImpl()
{ {
while (!mSurfaceSet.empty()) ASSERT(mSurfaceSet.empty());
{
destroySurface(*mSurfaceSet.begin());
}
} }
void DisplayImpl::destroySurface(egl::Surface *surface) void DisplayImpl::destroySurface(egl::Surface *surface)
......
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