- use BKE_keyingset_free_path where paths were being freed inline.

- rna_path was being freed when null, printing errors.
This commit is contained in:
2011-01-04 08:56:25 +00:00
parent a735629fd1
commit 9cafe19c70
3 changed files with 8 additions and 13 deletions

View File

@@ -916,10 +916,11 @@ void BKE_keyingset_free_path (KeyingSet *ks, KS_Path *ksp)
/* sanity check */
if ELEM(NULL, ks, ksp)
return;
/* free RNA-path info */
MEM_freeN(ksp->rna_path);
if(ksp->rna_path)
MEM_freeN(ksp->rna_path);
/* free path itself */
BLI_freelinkN(&ks->paths, ksp);
}

View File

@@ -418,12 +418,9 @@ static int remove_keyingset_button_exec (bContext *C, wmOperator *op)
/* try to find a path matching this description */
ksp= BKE_keyingset_find_path(ks, ptr.id.data, ks->name, path, index, KSP_GROUP_KSNAME);
if (ksp) {
/* just free it... */
MEM_freeN(ksp->rna_path);
BLI_freelinkN(&ks->paths, ksp);
BKE_keyingset_free_path(ks, ksp);
success= 1;
}

View File

@@ -4144,12 +4144,9 @@ static void do_outliner_keyingset_editop(SpaceOops *soops, KeyingSet *ks, ListBa
if (ksp) {
/* free path's data */
// TODO: we probably need an API method for this
if (ksp->rna_path) MEM_freeN(ksp->rna_path);
BKE_keyingset_free_path(ks, ksp);
ks->active_path= 0;
/* remove path from set */
BLI_freelinkN(&ks->paths, ksp);
}
}
break;