From 6e8ab3d68b2c0e5c9874a3d2f4ba34de56efa6b8 Mon Sep 17 00:00:00 2001 From: Carl Worth Date: Mon, 21 Jan 2008 17:02:59 -0800 Subject: [PATCH] Don't try to close connection if it's never been opened --- loudgame.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/loudgame.c b/loudgame.c index d99a0d2..65aeb35 100644 --- a/loudgame.c +++ b/loudgame.c @@ -33,11 +33,16 @@ loudgame_quit (loudgame_t *lg, int return_value) lg->return_value = return_value; - if (! lm_connection_close (lg->connection, &error)) - g_print ("An error occurred during lm_connection_close: %s\n", - error->message); - - lm_connection_unref (lg->connection); + if (lg->connection) + { + if (! lm_connection_close (lg->connection, &error)) + { + g_print ("An error occurred during lm_connection_close: %s\n", + error->message); + } + lm_connection_unref (lg->connection); + lg->connection = NULL; + } g_main_loop_quit (lg->main_loop); } -- 2.43.0