]> jfr.im git - irc/hexchat/hexchat.git/commitdiff
Don't flush the chanopt_list when saving it
authorLemonBoy <redacted>
Tue, 29 Mar 2016 17:38:34 +0000 (19:38 +0200)
committerPatrick Griffis <redacted>
Wed, 30 Mar 2016 12:11:07 +0000 (08:11 -0400)
Closes #1665
Fixes #1134

src/common/chanopt.c
src/common/chanopt.h
src/common/hexchat.c
src/common/outbound.c
src/fe-gtk/maingui.c

index 56d1b1ebd0ad469977177e0d04b7161562bc58d7..9b7c4f24153fe92e3d3be84cfbf0a1036707988c 100644 (file)
@@ -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;
index 18b9a43213fa2f8f77a1df697092b13782024eed..a5494605cc1bbf8f475a8797e536c4513160cea3 100644 (file)
@@ -22,7 +22,7 @@
 
 int chanopt_command (session *sess, char *tbuf, char *word[], char *word_eol[]);
 gboolean chanopt_is_set (unsigned int global, guint8 per_chan_setting);
-void chanopt_save_all (void);
+void chanopt_save_all (gboolean flush);
 void chanopt_save (session *sess);
 void chanopt_load (session *sess);
 
index caa20eb7fc823bfd11fc96b81d0d59c0e43c5dbe..499df8b0003f5facaf10efee8b0b30608f45ab4d 100644 (file)
@@ -960,7 +960,7 @@ hexchat_exit (void)
        notify_save ();
        ignore_save ();
        free_sessions ();
-       chanopt_save_all ();
+       chanopt_save_all (TRUE);
        servlist_cleanup ();
        fe_exit ();
 }
index 5ca8b78338fb3fd638db613882b92f7379ef306c..fed8371470fac173d9a065328f5ce151e7cc50ec 100644 (file)
@@ -581,7 +581,7 @@ cmd_chanopt (struct session *sess, char *tbuf, char *word[], char *word_eol[])
        
        /* chanopt.c */
        ret = chanopt_command (sess, tbuf, word, word_eol);
-       chanopt_save_all ();
+       chanopt_save_all (FALSE);
        
        return ret;
 }
index d718dba09cfa4020eac955342ca2a738b34dfb9c..6ab322bca5e4b7d9e0fa7c76879e766cec8e8337 100644 (file)
@@ -1514,7 +1514,7 @@ mg_set_guint8 (GtkCheckMenuItem *item, guint8 *setting)
                log_open_or_close (sess);
 
        chanopt_save (sess);
-       chanopt_save_all ();
+       chanopt_save_all (FALSE);
 }
 
 static void