Remove emailed ZIP files when they are no longer needed.
authorCarl Hetherington <cth@carlh.net>
Thu, 1 Jun 2017 00:11:53 +0000 (01:11 +0100)
committerCarl Hetherington <cth@carlh.net>
Thu, 1 Jun 2017 00:11:53 +0000 (01:11 +0100)
src/lib/cinema_kdms.cc

index dc9bfd3d77f83023142229c4374c2bbd6f66a773..1ec8546201895d0c5f247492a887960446c87e10 100644 (file)
@@ -246,6 +246,7 @@ CinemaKDMs::email (
                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);
@@ -255,6 +256,8 @@ CinemaKDMs::email (
                        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);