diff options
author | Campbell Barton <ideasman42@gmail.com> | 2012-12-22 05:08:42 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2012-12-22 05:08:42 +0400 |
commit | 2a5cabb039faf8a4f39a5dbe0edc0497a4f72b63 (patch) | |
tree | 27f63aa843429457bfacc67ac7698f11674538f0 /source/blender/windowmanager | |
parent | 78e688b71ced5ea4f34cfc4b3d913cfebaedd461 (diff) |
code cleanup and minor changes
- use DummyRNA_NULL_items to replace empty enums.
- replace calloc with malloc in copy_dverts since its copied over after.
- add wmGesture->userdata, so operators that use gestures have somewhere to store their own data (not used yet).
Diffstat (limited to 'source/blender/windowmanager')
-rw-r--r-- | source/blender/windowmanager/WM_types.h | 3 | ||||
-rw-r--r-- | source/blender/windowmanager/intern/wm_gesture.c | 3 |
2 files changed, 6 insertions, 0 deletions
diff --git a/source/blender/windowmanager/WM_types.h b/source/blender/windowmanager/WM_types.h index 347f46c8166..96a7b156cd8 100644 --- a/source/blender/windowmanager/WM_types.h +++ b/source/blender/windowmanager/WM_types.h @@ -407,6 +407,9 @@ typedef struct wmGesture { /* customdata for circle is recti, (xmin, ymin) is center, xmax radius */ /* customdata for lasso is short array */ /* customdata for straight line is a recti: (xmin,ymin) is start, (xmax, ymax) is end */ + + /* free pointer to use for operator allocs (if set, its freed on exit)*/ + void *userdata; } wmGesture; /* ************** wmEvent ************************ */ diff --git a/source/blender/windowmanager/intern/wm_gesture.c b/source/blender/windowmanager/intern/wm_gesture.c index a80386e9860..1cf44a69c17 100644 --- a/source/blender/windowmanager/intern/wm_gesture.c +++ b/source/blender/windowmanager/intern/wm_gesture.c @@ -113,6 +113,9 @@ void WM_gesture_end(bContext *C, wmGesture *gesture) win->tweak = NULL; BLI_remlink(&win->gesture, gesture); MEM_freeN(gesture->customdata); + if (gesture->userdata) { + MEM_freeN(gesture->userdata); + } MEM_freeN(gesture); } |