diff options
author | Campbell Barton <ideasman42@gmail.com> | 2017-07-30 08:47:57 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2017-07-30 08:47:57 +0300 |
commit | c90a3af8798e3d2910146a7b5e307a10a0e92f8c (patch) | |
tree | 9a1d318a496606be1f5f3f541a74033a8ee40685 /source | |
parent | 49c0ad1188b008a2238845db61486b27a956091e (diff) |
Manipulator: Check we don't add multiple times
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/windowmanager/manipulators/intern/wm_manipulator_map.c | 10 |
1 files changed, 9 insertions, 1 deletions
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; |