diff options
author | Campbell Barton <ideasman42@gmail.com> | 2011-01-04 13:37:22 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2011-01-04 13:37:22 +0300 |
commit | 1704a5546de3d67cf036696c2bbd2812eeea7060 (patch) | |
tree | 35a845a8eedcefe402f4362ebf14c8869b5bb1af /source/blender/makesrna/intern/makesrna.c | |
parent | f4cebea207ff173f6d2cf983ba86ca588726adca (diff) |
fix for makesrna error on windows where files cant be removed when open.
Diffstat (limited to 'source/blender/makesrna/intern/makesrna.c')
-rw-r--r-- | source/blender/makesrna/intern/makesrna.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/source/blender/makesrna/intern/makesrna.c b/source/blender/makesrna/intern/makesrna.c index c88b423ca49..6fbaa76e9df 100644 --- a/source/blender/makesrna/intern/makesrna.c +++ b/source/blender/makesrna/intern/makesrna.c @@ -72,6 +72,8 @@ static int replace_if_different(char *tmpfile, const char *dep_files[]) FILE *file_test= fopen(orgfile, "rb"); \ if(file_test) { \ fclose(file_test); \ + if(fp_org) fclose(fp_org); \ + if(fp_new) fclose(fp_new); \ if(remove(orgfile) != 0) { \ fprintf(stderr, "%s:%d, Remove Error (%s): \"%s\"\n", __FILE__, __LINE__, strerror(errno), orgfile); \ return -1; \ @@ -87,7 +89,7 @@ static int replace_if_different(char *tmpfile, const char *dep_files[]) /* end REN_IF_DIFF */ - FILE *fp_new, *fp_org; + FILE *fp_new= NULL, *fp_org= NULL; int len_new, len_org; char *arr_new, *arr_org; int cmp; |