* Contains management of ID's for freeing & deletion.
*/
-#include "CLG_log.h"
-
#include "MEM_guardedalloc.h"
/* all types are needed here, in order to do memory operations */
-#include "DNA_anim_types.h"
#include "DNA_armature_types.h"
#include "DNA_brush_types.h"
#include "DNA_camera_types.h"
#include "BKE_cachefile.h"
#include "BKE_collection.h"
#include "BKE_curve.h"
-#include "BKE_fcurve.h"
#include "BKE_font.h"
#include "BKE_gpencil.h"
#include "BKE_idprop.h"
+#include "BKE_idtype.h"
#include "BKE_image.h"
#include "BKE_ipo.h"
#include "BKE_key.h"
void BKE_libblock_free_datablock(ID *id, const int UNUSED(flag))
{
+ const IDTypeInfo *idtype_info = BKE_idtype_get_info_from_id(id);
+
+ if (idtype_info != NULL) {
+ if (idtype_info->free_data != NULL) {
+ idtype_info->free_data(id);
+ }
+ return;
+ }
+
const short type = GS(id->name);
switch (type) {
case ID_SCE: