diff options
author | Marcus Fritzsch <marcus.fritzsch@xse.de> | 2014-08-12 13:27:47 +0200 |
---|---|---|
committer | Nobuhiko Tanibata <NOBUHIKO_TANIBATA@denso.co.jp> | 2014-09-01 15:55:43 +0900 |
commit | 18af4f672fe40afcc210c2c81fedce84cefee558 (patch) | |
tree | 760502f912145b8ca1a5b24d543e840f1b16c00a | |
parent | b885bbc068386d31009f6f8a667d12ddf7e49da2 (diff) | |
download | wayland-ivi-extension-18af4f672fe40afcc210c2c81fedce84cefee558.tar.gz |
ilmControl: allow clean shutdown on partial init
Signed-off-by: Marcus Fritzsch <marcus.fritzsch@xse.de>
-rw-r--r-- | ivi-layermanagement-api/ilmControl/src/ilm_control_wayland_platform.c | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/ivi-layermanagement-api/ilmControl/src/ilm_control_wayland_platform.c b/ivi-layermanagement-api/ilmControl/src/ilm_control_wayland_platform.c index ed0a234..0b88998 100644 --- a/ivi-layermanagement-api/ilmControl/src/ilm_control_wayland_platform.c +++ b/ivi-layermanagement-api/ilmControl/src/ilm_control_wayland_platform.c @@ -993,13 +993,19 @@ static void destroy_control_resources(void) ctx->wl.controller = NULL; } - wl_display_flush(ctx->wl.display); + if (ctx->wl.display) { + wl_display_flush(ctx->wl.display); + } - wl_event_queue_destroy(ctx->wl.queue); - ctx->wl.queue = NULL; + if (ctx->wl.registry) { + wl_registry_destroy(ctx->wl.registry); + ctx->wl.registry = NULL; + } - wl_registry_destroy(ctx->wl.registry); - ctx->wl.registry = NULL; + if (ctx->wl.queue) { + wl_event_queue_destroy(ctx->wl.queue); + ctx->wl.queue = NULL; + } if (0 != pthread_mutex_destroy(&ctx->mutex)) { fprintf(stderr, "failed to destroy pthread_mutex\n"); |