Skip to content

Commit

Permalink
TizenRendererEvasGL: Add nullcheck for evas_gl_ (#320)
Browse files Browse the repository at this point in the history
DestorySurface is called more than once depending on the situation.
Add nullcheck to avoid destroying already destroyed evas_gl_ again.
  • Loading branch information
JSUYA authored Aug 1, 2022
1 parent 6c699b2 commit 1ca5867
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions shell/platform/tizen/tizen_renderer_evas_gl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -85,14 +85,18 @@ bool TizenRendererEvasGL::CreateSurface(void* render_target,
}

void TizenRendererEvasGL::DestroySurface() {
evas_gl_surface_destroy(evas_gl_, gl_surface_);
evas_gl_surface_destroy(evas_gl_, gl_resource_surface_);
if (evas_gl_) {
evas_gl_surface_destroy(evas_gl_, gl_surface_);
evas_gl_surface_destroy(evas_gl_, gl_resource_surface_);

evas_gl_context_destroy(evas_gl_, gl_context_);
evas_gl_context_destroy(evas_gl_, gl_resource_context_);
evas_gl_context_destroy(evas_gl_, gl_context_);
evas_gl_context_destroy(evas_gl_, gl_resource_context_);

evas_gl_config_free(gl_config_);
evas_gl_free(evas_gl_);
evas_gl_config_free(gl_config_);
evas_gl_free(evas_gl_);

evas_gl_ = nullptr;
}
}

bool TizenRendererEvasGL::OnMakeCurrent() {
Expand Down

0 comments on commit 1ca5867

Please sign in to comment.