From 7b884c46351bde98a371007b37e2ae13c8284ca6 Mon Sep 17 00:00:00 2001 From: Aleksander Morgado Date: Tue, 3 Jan 2012 19:59:10 +0100 Subject: [PATCH] base-modem-at: always unref the modem object in AT command/sequence contexts --- src/mm-base-modem-at.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/mm-base-modem-at.c b/src/mm-base-modem-at.c index a7b94ef2..4ecb64de 100644 --- a/src/mm-base-modem-at.c +++ b/src/mm-base-modem-at.c @@ -78,12 +78,11 @@ at_sequence_context_free (AtSequenceContext *ctx) { mm_serial_port_close (MM_SERIAL_PORT (ctx->port)); g_object_unref (ctx->port); + g_object_unref (ctx->self); if (ctx->response_processor_context && ctx->response_processor_context_free) ctx->response_processor_context_free (ctx->response_processor_context); - if (ctx->self) - g_object_unref (ctx->self); if (ctx->cancellable) g_object_unref (ctx->cancellable); if (ctx->result) @@ -361,13 +360,12 @@ typedef struct { static void at_command_context_free (AtCommandContext *ctx) { - if (ctx->self) - g_object_unref (ctx->self); if (ctx->cancellable) g_object_unref (ctx->cancellable); mm_serial_port_close (MM_SERIAL_PORT (ctx->port)); g_object_unref (ctx->port); g_object_unref (ctx->result); + g_object_unref (ctx->self); g_free (ctx); }