1
0
mirror of https://github.com/fwbuilder/fwbuilder synced 2026-03-25 04:37:22 +01:00

see #2082 Crash when deleting Policy object from cluster

This commit is contained in:
Vadim Kurland 2011-02-13 18:26:32 -08:00
parent 7de1edab4b
commit 31bd33cfea
3 changed files with 7 additions and 3 deletions

View File

@ -509,6 +509,7 @@ void ObjectManipulator::deleteObject(FWObject *obj, QUndoCommand* macro)
bool is_library = Library::isA(obj);
bool is_firewall = Firewall::cast(obj) != NULL; // includes Cluster too
bool is_deleted_object = (deleted_objects_lib!=NULL && obj->isChildOf(deleted_objects_lib));
// ruleset_visible == true if 1) we delete firewall object and one of its
// rulesets is visible in the project panel, or 2) we delete ruleset object
// which is visible in the project panel

View File

@ -742,7 +742,7 @@ RCS * ProjectPanel::getRCS()
*/
void ProjectPanel::addRule()
{
if (visibleRuleSet==NULL) return ;
if (visibleRuleSet==NULL || getCurrentRuleSetView()==NULL) return ;
getCurrentRuleSetView()->insertRule();
}

View File

@ -418,8 +418,11 @@ bool ProjectPanel::event(QEvent *event)
case CLOSE_OBJECT_EVENT:
if (RuleSet::cast(obj))
{
clearFirewallTabs();
closeRuleSet(obj);
if (visibleRuleSet == obj)
{
clearFirewallTabs();
closeRuleSet(obj);
}
} else
{
m_panel->om->closeObject();