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:
authorJeroen Bakker <jbakker>2021-03-09 17:19:00 +0300
committerJeroen Bakker <jeroen@blender.org>2021-03-09 17:19:12 +0300
commiteaada565910b4ff31081ced86c3b7242f2f28b4e (patch)
tree1b976dbc8b51f9c39bfb15894fc0b03686efc201 /source/blender/blenkernel/BKE_cryptomatte.hh
parentcdb0b3cedc9b242b75affadf0a0a33959320ab77 (diff)
Cleanup: add resource manager for cryptomatte session.
Auto frees cryptomatte session when it the pointer is collected from the stack. Reviewed By: Jacques Lucke Differential Revision: https://developer.blender.org/D10667
Diffstat (limited to 'source/blender/blenkernel/BKE_cryptomatte.hh')
-rw-r--r--source/blender/blenkernel/BKE_cryptomatte.hh11
1 files changed, 11 insertions, 0 deletions
diff --git a/source/blender/blenkernel/BKE_cryptomatte.hh b/source/blender/blenkernel/BKE_cryptomatte.hh
index f10b4c1f7c4..98fdfc965bc 100644
--- a/source/blender/blenkernel/BKE_cryptomatte.hh
+++ b/source/blender/blenkernel/BKE_cryptomatte.hh
@@ -29,6 +29,8 @@
#include "BLI_map.hh"
#include "BLI_string_ref.hh"
+#include "BKE_cryptomatte.h"
+
struct ID;
namespace blender::bke::cryptomatte {
@@ -103,4 +105,13 @@ struct CryptomatteStampDataCallbackData {
static void extract_layer_manifest(void *_data, const char *propname, char *propvalue, int len);
};
+struct CryptomatteSessionDeleter {
+ void operator()(CryptomatteSession *session)
+ {
+ BKE_cryptomatte_free(session);
+ }
+};
+
+using CryptomatteSessionPtr = std::unique_ptr<CryptomatteSession, CryptomatteSessionDeleter>;
+
} // namespace blender::bke::cryptomatte