浏览代码

Merge branch 'dev_1.17.5' of github.com:Unity-Technologies/com.unity.uiwidgets into editorwindow

/siyaoH-1.17-PlatformMessage
xingweizhu 4 年前
当前提交
e9471c6f
共有 1 个文件被更改,包括 12 次插入15 次删除
  1. 27
      engine/src/shell/platform/unity/windows/unity_surface_manager.cc

27
engine/src/shell/platform/unity/windows/unity_surface_manager.cc


void UnitySurfaceManager::CleanUp() {
EGLBoolean result = EGL_FALSE;
if (egl_display_ != EGL_NO_DISPLAY && egl_context_ != EGL_NO_CONTEXT) {
result = eglDestroyContext(egl_display_, egl_context_);
egl_context_ = EGL_NO_CONTEXT;
if (result == EGL_FALSE) {
FML_LOG(ERROR) << "EGL: Failed to destroy context";
}
}
d3d11_device_ = nullptr;
if (egl_display_ != EGL_NO_DISPLAY &&
egl_resource_context_ != EGL_NO_CONTEXT) {
result = eglDestroyContext(egl_display_, egl_resource_context_);

}
}
if (egl_display_ != EGL_NO_DISPLAY) {
result = eglTerminate(egl_display_);
egl_display_ = EGL_NO_DISPLAY;
if (egl_display_ != EGL_NO_DISPLAY && egl_context_ != EGL_NO_CONTEXT) {
result = eglDestroyContext(egl_display_, egl_context_);
egl_context_ = EGL_NO_CONTEXT;
FML_LOG(ERROR) << "EGL : Failed to terminate EGL";
FML_LOG(ERROR) << "EGL: Failed to destroy context";
//TODO: investigate a bit more on the possible memory leak here since egl_display_ will never be released
//refer to the commit log (9b39afd879d06626f5049cfae2a9cb852044c518) for the details
if (egl_display_ != EGL_NO_DISPLAY) {
egl_display_ = EGL_NO_DISPLAY;
}
d3d11_device_ = nullptr;
}
} // namespace uiwidgets
正在加载...
取消
保存