projects
/
dcpomatic.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
pot/merge.
[dcpomatic.git]
/
src
/
lib
/
cinema_kdms.cc
diff --git
a/src/lib/cinema_kdms.cc
b/src/lib/cinema_kdms.cc
index dc9bfd3d77f83023142229c4374c2bbd6f66a773..2b6a51e4179a95ac3d0b3727cdcdd641be96963b 100644
(file)
--- a/
src/lib/cinema_kdms.cc
+++ b/
src/lib/cinema_kdms.cc
@@
-208,7
+208,8
@@
CinemaKDMs::email (
name_values['c'] = i.cinema->name;
name_values['c'] = i.cinema->name;
- boost::filesystem::path zip_file = boost::filesystem::temp_directory_path();
+ boost::filesystem::path zip_file = boost::filesystem::temp_directory_path() / boost::filesystem::unique_path();
+ boost::filesystem::create_directories (zip_file);
zip_file /= container_name_format.get(name_values, ".zip");
i.make_zip_file (zip_file, filename_format, name_values);
zip_file /= container_name_format.get(name_values, ".zip");
i.make_zip_file (zip_file, filename_format, name_values);
@@
-246,6
+247,7
@@
CinemaKDMs::email (
try {
email.send (c->mail_server(), c->mail_port(), c->mail_user(), c->mail_password());
} catch (...) {
try {
email.send (c->mail_server(), c->mail_port(), c->mail_user(), c->mail_password());
} catch (...) {
+ boost::filesystem::remove (zip_file);
if (log) {
log->log ("Email content follows", LogEntry::TYPE_DEBUG_EMAIL);
log->log (email.email(), LogEntry::TYPE_DEBUG_EMAIL);
if (log) {
log->log ("Email content follows", LogEntry::TYPE_DEBUG_EMAIL);
log->log (email.email(), LogEntry::TYPE_DEBUG_EMAIL);
@@
-255,6
+257,8
@@
CinemaKDMs::email (
throw;
}
throw;
}
+ boost::filesystem::remove (zip_file);
+
if (log) {
log->log ("Email content follows", LogEntry::TYPE_DEBUG_EMAIL);
log->log (email.email(), LogEntry::TYPE_DEBUG_EMAIL);
if (log) {
log->log ("Email content follows", LogEntry::TYPE_DEBUG_EMAIL);
log->log (email.email(), LogEntry::TYPE_DEBUG_EMAIL);