diff options
author | Ton Roosendaal <ton@blender.org> | 2011-01-19 21:07:13 +0300 |
---|---|---|
committer | Ton Roosendaal <ton@blender.org> | 2011-01-19 21:07:13 +0300 |
commit | 36852b98cb6a29c5a172a2a3385a864aa223c7d3 (patch) | |
tree | 27d0705f480893f184e34a82c8b6dd253281745b | |
parent | d0f4e7767ecaf2158a7a5403537c78d8fa4439a4 (diff) |
Bugfix #25613
Dropping file in Blender from pre 2.5 period caused eternal loop
loading .blend files :)
-rw-r--r-- | source/blender/windowmanager/intern/wm_event_system.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/source/blender/windowmanager/intern/wm_event_system.c b/source/blender/windowmanager/intern/wm_event_system.c index be6700f2ea1..3c312a0c2b3 100644 --- a/source/blender/windowmanager/intern/wm_event_system.c +++ b/source/blender/windowmanager/intern/wm_event_system.c @@ -1470,21 +1470,26 @@ static int wm_handlers_do(bContext *C, wmEvent *event, ListBase *handlers) if(event->custom==EVT_DATA_LISTBASE) { ListBase *lb= (ListBase *)event->customdata; wmDrag *drag; + for(drag= lb->first; drag; drag= drag->next) { if(drop->poll(C, drag, event)) { + drop->copy(drag, drop); + /* free the drags before calling operator */ + BLI_freelistN(event->customdata); + event->customdata= NULL; + event->custom= 0; + WM_operator_name_call(C, drop->ot->idname, drop->opcontext, drop->ptr); - //wm_operator_invoke(C, drop->ot, event, drop->ptr, NULL, FALSE); action |= WM_HANDLER_BREAK; /* XXX fileread case */ if(CTX_wm_window(C)==NULL) return action; - BLI_freelistN(event->customdata); - event->customdata= NULL; - event->custom= 0; + /* escape from drag loop, got freed */ + break; } } } |