diff --git a/gfx/common/drm_common.c b/gfx/common/drm_common.c index 19e5274a95..1ef8a26a45 100644 --- a/gfx/common/drm_common.c +++ b/gfx/common/drm_common.c @@ -174,6 +174,9 @@ void drm_free(void) if (g_drm_resources) drmModeFreeResources(g_drm_resources); + memset(&g_drm_fds, 0, sizeof(struct pollfd)); + memset(&g_drm_evctx, 0, sizeof(drmEventContext)); + g_drm_encoder = NULL; g_drm_connector = NULL; g_drm_resources = NULL; diff --git a/gfx/drivers/exynos_gfx.c b/gfx/drivers/exynos_gfx.c index e878f1eafd..2467c0f595 100644 --- a/gfx/drivers/exynos_gfx.c +++ b/gfx/drivers/exynos_gfx.c @@ -595,9 +595,6 @@ fail: /* Counterpart to exynos_open. */ static void exynos_close(struct exynos_data *pdata) { - memset(&g_drm_fds, 0, sizeof(struct pollfd)); - memset(&g_drm_evctx, 0, sizeof(drmEventContext)); - memset(pdata->drmname, 0, sizeof(char) * 32); drm_free(); diff --git a/gfx/drivers_context/drm_egl_ctx.c b/gfx/drivers_context/drm_egl_ctx.c index 03def45b9b..8f576acd66 100644 --- a/gfx/drivers_context/drm_egl_ctx.c +++ b/gfx/drivers_context/drm_egl_ctx.c @@ -291,9 +291,6 @@ static void free_drm_resources(gfx_ctx_drm_egl_data_t *drm) drm_free(); - memset(&g_drm_fds, 0, sizeof(struct pollfd)); - memset(&g_drm_evctx, 0, sizeof(drmEventContext)); - if (g_drm_fd >= 0) retro_fclose(drm->g_drm);