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:
authorSybren A. Stüvel <sybren@blender.org>2021-09-24 17:34:13 +0300
committerSybren A. Stüvel <sybren@blender.org>2021-09-27 11:57:23 +0300
commit30ef197c7b57e2763f66abf21a4a148826c365f7 (patch)
tree111322b8e39b0ba4210b7b53e923a3a5e29f3c9f /source/blender/blenkernel/BKE_callbacks.h
parent617954c1438096810ce8e47f09c25c8311baac4d (diff)
Kernel: allow unregistering BKE callback functions
Introduce `BKE_callback_remove()`, which undoes the effect of `BKE_callback_add()`. It also respects `funcstore->alloc` by freeing the removed `funcstore` when needed. This allows for shorter-lived objects in memory to unregister their callbacks at the end of their lifespan. `BKE_callback_global_finalize()` has been adjusted so that the responsibility "remove a callback" is given to one function only. Reviewed by: campbellbarton Differential Revision: https://developer.blender.org/D12625
Diffstat (limited to 'source/blender/blenkernel/BKE_callbacks.h')
-rw-r--r--source/blender/blenkernel/BKE_callbacks.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/source/blender/blenkernel/BKE_callbacks.h b/source/blender/blenkernel/BKE_callbacks.h
index ef2a0ed34a0..7c518f33c89 100644
--- a/source/blender/blenkernel/BKE_callbacks.h
+++ b/source/blender/blenkernel/BKE_callbacks.h
@@ -130,6 +130,7 @@ void BKE_callback_exec_id_depsgraph(struct Main *bmain,
struct Depsgraph *depsgraph,
eCbEvent evt);
void BKE_callback_add(bCallbackFuncStore *funcstore, eCbEvent evt);
+void BKE_callback_remove(bCallbackFuncStore *funcstore, eCbEvent evt);
void BKE_callback_global_init(void);
void BKE_callback_global_finalize(void);