Qt: Reload widgets using prefs when reloading Lua plugins

Widgets using prefs must be closed because the prefs may have
been free'd when reloading Lua plugins.

Change-Id: I4b79b7aff18d7923c77a9eb05acadc29b156edbf
Reviewed-on: https://code.wireshark.org/review/10108
Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
This commit is contained in:
Stig Bjørlykke 2015-08-18 19:18:07 +02:00
parent 8fcdcb9c95
commit 97f3c1b88e
3 changed files with 10 additions and 0 deletions

View File

@ -2482,6 +2482,10 @@ void MainWindow::on_actionAnalyzeReloadLuaPlugins_triggered()
funnel_statistics_reload_menus();
reloadDynamicMenus();
// Preferences may have been deleted so close all widgets using prefs
proto_tree_->closeContextMenu();
main_ui_->preferenceEditorFrame->animatedHide();
char *gdp_path, *dp_path;
(void) wsApp->readConfigurationFiles(&gdp_path, &dp_path);

View File

@ -274,6 +274,11 @@ ProtoTree::ProtoTree(QWidget *parent) :
this, SIGNAL(editProtocolPreference(preference*,pref_module*)));
}
void ProtoTree::closeContextMenu()
{
ctx_menu_.close();
}
void ProtoTree::clear() {
updateSelectionStatus(NULL);
QTreeWidget::clear();

View File

@ -42,6 +42,7 @@ public:
void fillProtocolTree(proto_tree *protocol_tree);
void emitRelatedFrame(int related_frame, ft_framenum_type_t framenum_type = FT_FRAMENUM_NONE);
void goToField(int hf_id);
void closeContextMenu();
void clear();
protected: