[Bf-blender-cvs] [ac2b1663ef9] blender2.8: Cleanup: remove next/prev from manipulator map

Campbell Barton noreply at git.blender.org
Mon Jul 31 03:15:26 CEST 2017


Commit: ac2b1663ef9616b61a2e9054330f3755cca34cff
Author: Campbell Barton
Date:   Mon Jul 31 11:26:03 2017 +1000
Branches: blender2.8
https://developer.blender.org/rBac2b1663ef9616b61a2e9054330f3755cca34cff

Cleanup: remove next/prev from manipulator map

===================================================================

M	source/blender/blenkernel/intern/screen.c
M	source/blender/windowmanager/manipulators/intern/wm_manipulator_intern.h
M	source/blender/windowmanager/manipulators/intern/wm_manipulator_map.c

===================================================================

diff --git a/source/blender/blenkernel/intern/screen.c b/source/blender/blenkernel/intern/screen.c
index f3a93a0a42c..237120b090d 100644
--- a/source/blender/blenkernel/intern/screen.c
+++ b/source/blender/blenkernel/intern/screen.c
@@ -353,7 +353,10 @@ void BKE_area_region_free(SpaceType *st, ARegion *ar)
 		}
 	}
 
-	region_free_manipulatormap_callback(ar->manipulator_map);
+	if (ar->manipulator_map != NULL) {
+		region_free_manipulatormap_callback(ar->manipulator_map);
+	}
+
 	BLI_freelistN(&ar->ui_lists);
 	BLI_freelistN(&ar->ui_previews);
 	BLI_freelistN(&ar->panels_category);
diff --git a/source/blender/windowmanager/manipulators/intern/wm_manipulator_intern.h b/source/blender/windowmanager/manipulators/intern/wm_manipulator_intern.h
index b8be482c3b8..b4603d5281c 100644
--- a/source/blender/windowmanager/manipulators/intern/wm_manipulator_intern.h
+++ b/source/blender/windowmanager/manipulators/intern/wm_manipulator_intern.h
@@ -91,7 +91,6 @@ typedef struct wmManipulatorMapSelectState {
 } wmManipulatorMapSelectState;
 
 struct wmManipulatorMap {
-	struct wmManipulatorMap *next, *prev;
 
 	struct wmManipulatorMapType *type;
 	ListBase groups;  /* wmManipulatorGroup */
diff --git a/source/blender/windowmanager/manipulators/intern/wm_manipulator_map.c b/source/blender/windowmanager/manipulators/intern/wm_manipulator_map.c
index 1a96846e75d..210243d5fff 100644
--- a/source/blender/windowmanager/manipulators/intern/wm_manipulator_map.c
+++ b/source/blender/windowmanager/manipulators/intern/wm_manipulator_map.c
@@ -179,9 +179,6 @@ wmManipulatorMap *WM_manipulatormap_new_from_type(
 
 void wm_manipulatormap_remove(wmManipulatorMap *mmap)
 {
-	if (!mmap)
-		return;
-
 	/* Clear first so further calls don't waste time trying to maintain correct array state. */
 	wm_manipulatormap_select_array_clear(mmap);
 
@@ -752,12 +749,10 @@ void wm_manipulatormap_handler_context(bContext *C, wmEventHandler *handler)
 
 bool WM_manipulatormap_cursor_set(const wmManipulatorMap *mmap, wmWindow *win)
 {
-	for (; mmap; mmap = mmap->next) {
-		wmManipulator *mpr = mmap->mmap_context.highlight;
-		if (mpr && mpr->type->cursor_get) {
-			WM_cursor_set(win, mpr->type->cursor_get(mpr));
-			return true;
-		}
+	wmManipulator *mpr = mmap->mmap_context.highlight;
+	if (mpr && mpr->type->cursor_get) {
+		WM_cursor_set(win, mpr->type->cursor_get(mpr));
+		return true;
 	}
 
 	return false;




More information about the Bf-blender-cvs mailing list