Spp channel is created at socket connection time, so if socket is created
but not connected , g_io_channel_shutdown() should not be called with a null channel.
Otherwise we get this glib error :
GLib-CRITICAL **: g_io_channel_shutdown: assertion `channel != NULL' failed
Change-Id: Ib013c42f3d9518945a4aba8b77922795795c3403
Signed-off-by: Corentin Lecouvey <corentin.lecouvey@open.eurogiciel.org>
spp_ctx_list = g_list_remove(spp_ctx_list, spp_ctx);
- g_io_channel_shutdown(spp_ctx->channel, TRUE, NULL);
- g_io_channel_unref(spp_ctx->channel);
+ if (spp_ctx->channel) {
+ g_io_channel_shutdown(spp_ctx->channel, TRUE, NULL);
+ g_io_channel_unref(spp_ctx->channel);
+ }
free_spp_context(spp_ctx);