Revert to master - those changes are globally valid, but remain incomplete,
[blender.git] / source / blender / makesrna / intern / rna_main_api.c
index fdb5d952e30282b21e5832d375d3650249c706c8..5a0da0b76517fa9c2ac9f010d1c27c908703fabb 100644 (file)
@@ -733,7 +733,7 @@ static Mask *rna_Main_mask_new(Main *bmain, const char *name)
 static void rna_Main_masks_remove(Main *bmain, PointerRNA *mask_ptr)
 {
        Mask *mask = mask_ptr->data;
-       BKE_mask_unlink(bmain, mask);
+       BKE_mask_free(bmain, mask);
        BKE_libblock_free(bmain, mask);
        RNA_POINTER_INVALIDATE(mask_ptr);
 }
@@ -742,6 +742,7 @@ static void rna_Main_grease_pencil_remove(Main *bmain, ReportList *reports, Poin
 {
        bGPdata *gpd = gpd_ptr->data;
        if (ID_REAL_USERS(gpd) <= 0) {
+               BKE_gpencil_free(gpd);
                BKE_libblock_free(bmain, gpd);
                RNA_POINTER_INVALIDATE(gpd_ptr);
        }