[Bf-blender-cvs] [c90a3af8798] blender2.8: Manipulator: Check we don't add multiple times
Campbell Barton
noreply at git.blender.org
Sun Jul 30 07:35:49 CEST 2017
Commit: c90a3af8798e3d2910146a7b5e307a10a0e92f8c
Author: Campbell Barton
Date: Sun Jul 30 15:47:57 2017 +1000
Branches: blender2.8
https://developer.blender.org/rBc90a3af8798e3d2910146a7b5e307a10a0e92f8c
Manipulator: Check we don't add multiple times
===================================================================
M source/blender/windowmanager/manipulators/intern/wm_manipulator_map.c
===================================================================
diff --git a/source/blender/windowmanager/manipulators/intern/wm_manipulator_map.c b/source/blender/windowmanager/manipulators/intern/wm_manipulator_map.c
index 9680b85f0c6..5b93db88d3b 100644
--- a/source/blender/windowmanager/manipulators/intern/wm_manipulator_map.c
+++ b/source/blender/windowmanager/manipulators/intern/wm_manipulator_map.c
@@ -567,7 +567,15 @@ wmManipulator *wm_manipulatormap_highlight_find(
void WM_manipulatormap_add_handlers(ARegion *ar, wmManipulatorMap *mmap)
{
- wmEventHandler *handler = MEM_callocN(sizeof(wmEventHandler), "manipulator handler");
+ wmEventHandler *handler;
+
+ for (handler = ar->handlers.first; handler; handler = handler->next) {
+ if (handler->manipulator_map == mmap) {
+ return;
+ }
+ }
+
+ handler = MEM_callocN(sizeof(wmEventHandler), "manipulator handler");
BLI_assert(mmap == ar->manipulator_map);
handler->manipulator_map = mmap;
More information about the Bf-blender-cvs
mailing list