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:
authorNathan Letwory <nathan@letworyinteractive.com>2010-09-18 02:12:23 +0400
committerNathan Letwory <nathan@letworyinteractive.com>2010-09-18 02:12:23 +0400
commita06c46d8dd552a651c90f0ca9805bfbba04cb193 (patch)
tree93c6dd1140ead737eb683d74a22c668cfb8f7025 /source/blender/editors/space_file/file_ops.c
parentb4a4c330540deeb7ea9e5f749e9fbf0768731b68 (diff)
Apply patch [#23846] Fix for [#23698] in File Browser system. Properly removes handler and sfile when File selector disapears.
Patch by Alexander Kuznetsov Reported by Chidozie Oku From patch description: " Handler is now released on every exit from File Selector. For example pressing ctrl-up and then changing editor type to another also releases the handler. When an area is changed from SPACE_FILE, ED_fileselect_exit is called for clean up. It takes function of freeing folder list and files (before it was done in cancel or exec functions) because they must be released on every exit anyway. op!=null means cancel or exec was not executed so a handler was not released. ED_fileselect_exit then releases the handler without changing screens. " Thanks!
Diffstat (limited to 'source/blender/editors/space_file/file_ops.c')
-rw-r--r--source/blender/editors/space_file/file_ops.c21
1 files changed, 4 insertions, 17 deletions
diff --git a/source/blender/editors/space_file/file_ops.c b/source/blender/editors/space_file/file_ops.c
index 9393f1c4d6d..7888fdeef8a 100644
--- a/source/blender/editors/space_file/file_ops.c
+++ b/source/blender/editors/space_file/file_ops.c
@@ -507,18 +507,11 @@ void FILE_OT_highlight(struct wmOperatorType *ot)
int file_cancel_exec(bContext *C, wmOperator *unused)
{
SpaceFile *sfile= CTX_wm_space_file(C);
-
- folderlist_free(sfile->folders_prev);
- folderlist_free(sfile->folders_next);
-
- WM_event_fileselect_event(C, sfile->op, EVT_FILESELECT_CANCEL);
- sfile->op = NULL;
+ wmOperator *op = sfile->op;
- if (sfile->files) {
- ED_fileselect_clear(C, sfile);
- MEM_freeN(sfile->files);
- sfile->files= NULL;
- }
+ sfile->op = NULL;
+
+ WM_event_fileselect_event(C, op, EVT_FILESELECT_CANCEL);
return OPERATOR_FINISHED;
}
@@ -686,17 +679,11 @@ int file_exec(bContext *C, wmOperator *exec_op)
file_sfile_to_operator(op, sfile, filepath);
- folderlist_free(sfile->folders_prev);
- folderlist_free(sfile->folders_next);
-
fsmenu_insert_entry(fsmenu_get(), FS_CATEGORY_RECENT, sfile->params->dir,0, 1);
BLI_make_file_string(G.sce, filepath, BLI_get_folder_create(BLENDER_USER_CONFIG, NULL), BLENDER_BOOKMARK_FILE);
fsmenu_write_file(fsmenu_get(), filepath);
WM_event_fileselect_event(C, op, EVT_FILESELECT_EXEC);
- ED_fileselect_clear(C, sfile);
- MEM_freeN(sfile->files);
- sfile->files= NULL;
}
return OPERATOR_FINISHED;