diff --git a/source/blender/blenkernel/intern/asset.cc b/source/blender/blenkernel/intern/asset.cc index 1337c017ffd..0b3daf5eee9 100644 --- a/source/blender/blenkernel/intern/asset.cc +++ b/source/blender/blenkernel/intern/asset.cc @@ -52,18 +52,10 @@ AssetMetaData *BKE_asset_metadata_copy(const AssetMetaData *source) BKE_asset_metadata_catalog_id_set(copy, source->catalog_id, source->catalog_simple_name); - if (source->author) { - copy->author = BLI_strdup(source->author); - } - if (source->description) { - copy->description = BLI_strdup(source->description); - } - if (source->copyright) { - copy->copyright = BLI_strdup(source->copyright); - } - if (source->license) { - copy->license = BLI_strdup(source->license); - } + copy->author = BLI_strdup_null(source->author); + copy->description = BLI_strdup_null(source->description); + copy->copyright = BLI_strdup_null(source->copyright); + copy->license = BLI_strdup_null(source->license); BLI_duplicatelist(©->tags, &source->tags); copy->active_tag = source->active_tag; diff --git a/source/blender/makesdna/DNA_asset_types.h b/source/blender/makesdna/DNA_asset_types.h index 0c6ba9fdcd9..26ab4b700a9 100644 --- a/source/blender/makesdna/DNA_asset_types.h +++ b/source/blender/makesdna/DNA_asset_types.h @@ -50,11 +50,6 @@ typedef struct AssetFilterSettings { * more than that from the file. So pointers to other IDs or ID data are strictly forbidden. */ typedef struct AssetMetaData { -#ifdef __cplusplus - /** Enables use with `std::unique_ptr`. */ - ~AssetMetaData(); -#endif - /** Runtime type, to reference event callbacks. Only valid for local assets. */ struct AssetTypeInfo *local_type_info; @@ -96,6 +91,11 @@ typedef struct AssetMetaData { short tot_tags; char _pad[4]; + +#ifdef __cplusplus + /** Enables use with `std::unique_ptr`. */ + ~AssetMetaData(); +#endif } AssetMetaData; typedef enum eAssetLibraryType {