Commit 30cc040365108b0f9099c0cccd81285bb04d6335
1 parent
6f130e93
delete flat_gallery and open file at beginning
Showing
1 changed file
with
2 additions
and
1 deletions
openbr/janus_io.cpp
| @@ -57,8 +57,9 @@ janus_error janus_create_templates(const char *data_path, janus_metadata metadat | @@ -57,8 +57,9 @@ janus_error janus_create_templates(const char *data_path, janus_metadata metadat | ||
| 57 | JANUS_ASSERT(janus_flatten_gallery(gallery, flat_gallery, &bytes)) | 57 | JANUS_ASSERT(janus_flatten_gallery(gallery, flat_gallery, &bytes)) |
| 58 | 58 | ||
| 59 | std::ofstream file; | 59 | std::ofstream file; |
| 60 | - file.open(gallery_file, std::ios::out | std::ios::binary | std::ios::ate); | 60 | + file.open(gallery_file, std::ios::out | std::ios::binary); |
| 61 | file.write((char*)flat_gallery, bytes); | 61 | file.write((char*)flat_gallery, bytes); |
| 62 | file.close(); | 62 | file.close(); |
| 63 | + delete[] flat_gallery; | ||
| 63 | return JANUS_SUCCESS; | 64 | return JANUS_SUCCESS; |
| 64 | } | 65 | } |