Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'source/blender/blenlib/BLI_resource_collector.hh')
-rw-r--r--source/blender/blenlib/BLI_resource_collector.hh6
1 files changed, 6 insertions, 0 deletions
diff --git a/source/blender/blenlib/BLI_resource_collector.hh b/source/blender/blenlib/BLI_resource_collector.hh
index 10d610da618..e1be87d8af2 100644
--- a/source/blender/blenlib/BLI_resource_collector.hh
+++ b/source/blender/blenlib/BLI_resource_collector.hh
@@ -79,6 +79,12 @@ class ResourceCollector : NonCopyable, NonMovable {
*/
template<typename T> void add(destruct_ptr<T> resource, const char *name)
{
+ /* There is no need to keep track of such types. */
+ if (std::is_trivially_destructible_v<T>) {
+ resource.release();
+ return;
+ }
+
BLI_assert(resource.get() != nullptr);
this->add(
resource.release(),