diff options
author | Eugen Friedrich <efriedrich@de.adit-jv.com> | 2023-01-07 13:34:38 +0100 |
---|---|---|
committer | Eugen Friedrich <efriedrich@de.adit-jv.com> | 2023-01-07 13:34:38 +0100 |
commit | e6b2545ed26ec3b8ee60bb13a4c6c5afe23118de (patch) | |
tree | 7e74833f6e4412932aa085e0e49e1447820ae19c | |
parent | 7af7e64fb14a00e744e18895cd36029d8ceb4a03 (diff) | |
parent | b5878a99cf34a07fbe0065db11265fd1145b27af (diff) | |
download | wayland-ivi-extension-e6b2545ed26ec3b8ee60bb13a4c6c5afe23118de.tar.gz |
Merge remote-tracking branch 'upstream/pull/136'
* upstream/pull/136
EGLWLInputEventExample: fix crash when exit
Reviewed-by: Eugen Friedrich <efriedrich@de.adit-jv.com>
Reviewed-by: Harsha M M <harsha.manjulamallikarjun@in.bosch.com>
Tested-by: Doan Ngoc Au <au.doanngoc@vn.bosch.com>
-rw-r--r-- | ivi-layermanagement-examples/EGLWLInputEventExample/src/WLContext.cpp | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/ivi-layermanagement-examples/EGLWLInputEventExample/src/WLContext.cpp b/ivi-layermanagement-examples/EGLWLInputEventExample/src/WLContext.cpp index dedb5a8..edcbaff 100644 --- a/ivi-layermanagement-examples/EGLWLInputEventExample/src/WLContext.cpp +++ b/ivi-layermanagement-examples/EGLWLInputEventExample/src/WLContext.cpp @@ -85,7 +85,6 @@ create_cursors(WLContext* wlContext) fprintf(stderr, "could not load default theme\n"); return; } - wlContext->SetWLCursor((wl_cursor*) malloc(sizeof(wl_cursor))); for (j = 0; !cursor && j < ARRAY_SIZE(left_ptrs); ++j) cursor = wl_cursor_theme_get_cursor(wlContext->GetWLCursorTheme(), @@ -171,11 +170,10 @@ WLContext::SeatHandleCapabilities(void* data, struct wl_seat* seat, uint32_t cap context->ctx->SetPointerSurface(NULL); } - if (context->ctx->GetWLCursorTheme()) + if (context->ctx->GetWLCursorTheme()){ wl_cursor_theme_destroy(context->ctx->GetWLCursorTheme()); - - if (context->ctx->GetWLCursor()) - free(context->ctx->GetWLCursor()); + context->ctx->SetWLCursor(NULL); + } } if ((caps & WL_SEAT_CAPABILITY_KEYBOARD) && !context->wlKeyboard){ @@ -236,11 +234,11 @@ WLContext::DestroyWLContext() m_pointerSurface = NULL; } - if (m_wlCursorTheme) + if (m_wlCursorTheme){ wl_cursor_theme_destroy(m_wlCursorTheme); - - if (m_wlCursor) - free(m_wlCursor); + m_wlCursorTheme = NULL; + m_wlCursor = NULL; + } wl_registry_destroy(m_wlRegistry); wl_display_flush(m_wlDisplay); |