Empty the surface and context sets on terminate

TRAC #13623 This prevents a crash when the application calls eglTerminate multiple times without destroying the contexts or surfaces. Signed-off-by: Daniel Koch Author: Nicolas Capens git-svn-id: https://angleproject.googlecode.com/svn/trunk@435 736b8ea6-26fd-11df-bfd4-992fa37f6226
parent d3958d73
......@@ -204,14 +204,14 @@ bool Display::initialize()
void Display::terminate()
{
for (SurfaceSet::iterator surface = mSurfaceSet.begin(); surface != mSurfaceSet.end(); surface++)
while (!mSurfaceSet.empty())
{
delete *surface;
destroySurface(*mSurfaceSet.begin());
}
for (ContextSet::iterator context = mContextSet.begin(); context != mContextSet.end(); context++)
while (!mContextSet.empty())
{
glDestroyContext(*context);
destroyContext(*mContextSet.begin());
}
if (mDevice)
......
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