Commit 22a5f5f0 by Geoff Lang Committed by Commit Bot

Make sure to destroy all resources in DisplayWGL if initialization fails.

It was possible to leak some resources if initialization fails half way through. BUG=angleproject:2546 Change-Id: I0ea75a274fed27b118e788785bb72aff5fe8381e Reviewed-on: https://chromium-review.googlesource.com/1070221Reviewed-by: 's avatarYuly Novikov <ynovikov@chromium.org> Commit-Queue: Geoff Lang <geofflang@chromium.org>
parent 2a12b3d5
...@@ -67,6 +67,9 @@ class DisplayWGL : public DisplayGL ...@@ -67,6 +67,9 @@ class DisplayWGL : public DisplayGL
void releaseD3DDevice(HANDLE handle); void releaseD3DDevice(HANDLE handle);
private: private:
egl::Error initializeImpl(egl::Display *display);
void destroy();
const FunctionsGL *getFunctionsGL() const override; const FunctionsGL *getFunctionsGL() const override;
egl::Error initializeD3DDevice(); egl::Error initializeD3DDevice();
...@@ -108,8 +111,6 @@ class DisplayWGL : public DisplayGL ...@@ -108,8 +111,6 @@ class DisplayWGL : public DisplayGL
size_t refCount; size_t refCount;
}; };
std::map<IUnknown *, D3DObjectHandle> mRegisteredD3DDevices; std::map<IUnknown *, D3DObjectHandle> mRegisteredD3DDevices;
egl::Display *mDisplay;
}; };
} }
......
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