summary refs log tree commit diff stats
path: root/src/common/chanopt.c
diff options
context:
space:
mode:
authorLemonBoy <thatlemon@gmail.com>2016-03-29 19:38:34 +0200
committerPatrick Griffis <tingping@tingping.se>2016-03-30 08:11:07 -0400
commit0635e91dd6f43ae4944e845cc44a429dbd2352fb (patch)
tree155543f7704bf4486b377596bc463d5fdc586378 /src/common/chanopt.c
parent5f2d6a3c115b8029b43c57e7c808a7191956e287 (diff)
Don't flush the chanopt_list when saving it
Closes #1665
Fixes #1134
Diffstat (limited to 'src/common/chanopt.c')
-rw-r--r--src/common/chanopt.c18
1 files changed, 12 insertions, 6 deletions
diff --git a/src/common/chanopt.c b/src/common/chanopt.c
index 56d1b1eb..9b7c4f24 100644
--- a/src/common/chanopt.c
+++ b/src/common/chanopt.c
@@ -396,7 +396,7 @@ chanopt_save_one_channel (chanopt_in_memory *co, int fh)
 }
 
 void
-chanopt_save_all (void)
+chanopt_save_all (gboolean flush)
 {
 	int i;
 	int num_saved;
@@ -438,15 +438,21 @@ chanopt_save_all (void)
 		}
 
 cont:
-		g_free (co->network);
-		g_free (co->channel);
-		g_free (co);
+		if (flush)
+		{
+			g_free (co->network);
+			g_free (co->channel);
+			g_free (co);
+		}
 	}
 
 	close (fh);
 
-	g_slist_free (chanopt_list);
-	chanopt_list = NULL;
+	if (flush)
+	{
+		g_slist_free (chanopt_list);
+		chanopt_list = NULL;
+	}
 
 	chanopt_open = FALSE;
 	chanopt_changed = FALSE;