When applying preferences, we have to apply the protocol preferences

before applying any other preferences, as, before we've applied them,
the internal state of the preferences in some dissectors might be
inconsistent (for example, the 802.11 dissector might've had its
number-of-WEP-keys preference increased but might not yet have allocated
a table for the WEP keys), and, as "gui_prefs_apply()" could cause a
redissection when redisplaying, that could cause dissectors to
malfunction (e.g., crash).

svn path=/trunk/; revision=12102
This commit is contained in:
Guy Harris 2004-09-25 22:50:58 +00:00
parent 85d6e3905d
commit 3bee1b0611
1 changed files with 7 additions and 3 deletions

View File

@ -1005,7 +1005,13 @@ prefs_main_fetch_all(GtkWidget *dlg, gboolean *must_redissect)
static void
prefs_main_apply_all(GtkWidget *dlg)
{
/* Now apply those preferences. */
/*
* Apply the protocol preferences first - "gui_prefs_apply()" could
* cause redissection, and we have to make sure the protocol
* preference changes have been fully applied.
*/
prefs_apply_all();
gui_prefs_apply(OBJECT_GET_DATA(dlg, E_GUI_PAGE_KEY));
layout_prefs_apply(OBJECT_GET_DATA(dlg, E_GUI_LAYOUT_PAGE_KEY));
column_prefs_apply(OBJECT_GET_DATA(dlg, E_GUI_COLUMN_PAGE_KEY));
@ -1023,8 +1029,6 @@ prefs_main_apply_all(GtkWidget *dlg)
#endif /* HAVE_LIBPCAP */
printer_prefs_apply(OBJECT_GET_DATA(dlg, E_PRINT_PAGE_KEY));
nameres_prefs_apply(OBJECT_GET_DATA(dlg, E_NAMERES_PAGE_KEY));
prefs_apply_all();
}