Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2011-06-17 16:48:33 +0400
committerCampbell Barton <ideasman42@gmail.com>2011-06-17 16:48:33 +0400
commit68a12c74b6ebd64f85b22b13902a467bc5d6b496 (patch)
tree6a4e8b070851a0ed32e5aada4f37d2ffb5251e8f /source/blender/editors/interface
parent46ef1bb17093391418b38c470d77c1182193fe1f (diff)
fix [#26621] Memory leaks when creating popup window.
also fixes memory leak when cancelling a popup dialog (new image for example).
Diffstat (limited to 'source/blender/editors/interface')
-rw-r--r--source/blender/editors/interface/interface_regions.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/source/blender/editors/interface/interface_regions.c b/source/blender/editors/interface/interface_regions.c
index 623651083d2..62043f240e4 100644
--- a/source/blender/editors/interface/interface_regions.c
+++ b/source/blender/editors/interface/interface_regions.c
@@ -2582,6 +2582,25 @@ void uiPupBlock(bContext *C, uiBlockCreateFunc func, void *arg)
uiPupBlockO(C, func, arg, NULL, 0);
}
+void uiPupBlockEx(bContext *C, uiBlockCreateFunc func, uiBlockCancelFunc cancel_func, void *arg)
+{
+ wmWindow *window= CTX_wm_window(C);
+ uiPopupBlockHandle *handle;
+
+ handle= ui_popup_block_create(C, NULL, NULL, func, NULL, arg);
+ handle->popup= 1;
+ handle->retvalue= 1;
+
+ handle->popup_arg= arg;
+ // handle->popup_func= operator_cb;
+ handle->cancel_func= cancel_func;
+ // handle->opcontext= opcontext;
+
+ UI_add_popup_handlers(C, &window->modalhandlers, handle);
+ WM_event_add_mousemove(C);
+}
+
+#if 0 /* UNUSED */
void uiPupBlockOperator(bContext *C, uiBlockCreateFunc func, wmOperator *op, int opcontext)
{
wmWindow *window= CTX_wm_window(C);
@@ -2599,6 +2618,7 @@ void uiPupBlockOperator(bContext *C, uiBlockCreateFunc func, wmOperator *op, int
UI_add_popup_handlers(C, &window->modalhandlers, handle);
WM_event_add_mousemove(C);
}
+#endif
void uiPupBlockClose(bContext *C, uiBlock *block)
{