Fixes crashing when opening color filters and pressing OK
(introduced in SVN 23560) svn path=/trunk/; revision=23582
This commit is contained in:
parent
6f1ab30f2f
commit
db2f6ce546
|
@ -313,21 +313,23 @@ color_filter_validate_cb(gpointer filter_arg, gpointer unused _U_)
|
|||
|
||||
/* apply changes from the edit list */
|
||||
void
|
||||
color_filters_apply(GSList *cfl)
|
||||
color_filters_apply(GSList *tmp_cfl, GSList *edit_cfl)
|
||||
{
|
||||
/* "move" old entries to the deleted list
|
||||
* we must keep them until the dissection no longer needs them */
|
||||
color_filter_deleted_list = g_slist_concat(color_filter_deleted_list, color_filter_list);
|
||||
color_filter_list = NULL;
|
||||
|
||||
/* clone all list entries from edit to normal list */
|
||||
/* clone all list entries from tmp/edit to normal list */
|
||||
color_filter_valid_list = NULL;
|
||||
color_filter_valid_list = color_filter_list_clone(cfl);
|
||||
color_filter_valid_list = color_filter_list_clone(tmp_cfl);
|
||||
color_filter_valid_list = g_slist_concat(color_filter_valid_list,
|
||||
color_filter_list_clone(edit_cfl) );
|
||||
|
||||
/* compile all filter */
|
||||
g_slist_foreach(color_filter_valid_list, color_filter_validate_cb, NULL);
|
||||
|
||||
/* clone all list entries from edit to normal list */
|
||||
/* clone all list entries from tmp/edit to normal list */
|
||||
color_filter_list = color_filter_list_clone(color_filter_valid_list);
|
||||
|
||||
/* compile all filter */
|
||||
|
|
|
@ -125,9 +125,10 @@ void color_filter_add_cb (color_filter_t *colorf, gpointer user_data);
|
|||
|
||||
/** Apply a changed filter list.
|
||||
*
|
||||
* @param cfl the filter list to apply
|
||||
* @param tmp_cfl the temporary color filter list to apply
|
||||
* @param edit_cfl the edited permanent color filter list to apply
|
||||
*/
|
||||
void color_filters_apply(GSList *cfl);
|
||||
void color_filters_apply(GSList *tmp_cfl, GSList *edit_cfl);
|
||||
|
||||
/** Save filters in users filter file.
|
||||
*
|
||||
|
|
|
@ -1303,8 +1303,6 @@ color_ok_cb(GtkButton *button _U_, gpointer user_data _U_)
|
|||
static void
|
||||
color_apply_cb(GtkButton *button _U_, gpointer user_data _U_)
|
||||
{
|
||||
GSList *cfl;
|
||||
|
||||
/* if we don't have a Save button, just save the settings now */
|
||||
if (!prefs.gui_use_pref_save) {
|
||||
if (!color_filters_write(color_filter_edit_list))
|
||||
|
@ -1312,10 +1310,10 @@ color_apply_cb(GtkButton *button _U_, gpointer user_data _U_)
|
|||
"Could not open filter file: %s", strerror(errno));
|
||||
}
|
||||
|
||||
/* merge the temporary coloring filters with the ones that just
|
||||
* have been edited and apply them both */
|
||||
cfl = g_slist_concat(color_filter_tmp_list, color_filter_edit_list);
|
||||
color_filters_apply(cfl);
|
||||
/* Apply the coloring rules, both the temporary ones in
|
||||
* color_filter_tmp_list as the permanent ones in color_filter_edit_list
|
||||
* */
|
||||
color_filters_apply(color_filter_tmp_list, color_filter_edit_list);
|
||||
|
||||
/* colorize list */
|
||||
cf_colorize_packets(&cfile);
|
||||
|
|
Loading…
Reference in New Issue