Fix T49746: crash loading user preferences with missing operators.

This commit is contained in:
Brecht Van Lommel 2016-10-16 21:19:52 +02:00 committed by Sergey Sharybin
parent 8030c4832a
commit a6220f459b
1 changed files with 6 additions and 1 deletions

View File

@ -77,6 +77,10 @@ static wmKeyMapItem *wm_keymap_item_copy(wmKeyMapItem *kmi)
kmin->properties = IDP_CopyProperty(kmin->properties);
kmin->ptr->data = kmin->properties;
}
else {
kmin->properties = NULL;
kmin->ptr = NULL;
}
return kmin;
}
@ -87,6 +91,8 @@ static void wm_keymap_item_free(wmKeyMapItem *kmi)
if (kmi->ptr) {
WM_operator_properties_free(kmi->ptr);
MEM_freeN(kmi->ptr);
kmi->ptr = NULL;
kmi->properties = NULL;
}
}
@ -121,7 +127,6 @@ static void wm_keymap_item_properties_update_ot(wmKeyMapItem *kmi)
else {
/* zombie keymap item */
wm_keymap_item_free(kmi);
kmi->ptr = NULL;
}
}
}