diff options
author | Jani Nikula <jani@nikula.org> | 2013-11-03 14:24:42 +0200 |
---|---|---|
committer | David Bremner <david@tethera.net> | 2013-11-06 17:49:36 -0400 |
commit | 8e4e537ceefec51fc811d0be3027572a904ba38c (patch) | |
tree | df94dab0f6edbbd56b07043c498af925ff19c78c /lib/database.cc | |
parent | 425e73e1461b8f7379bf0d5290b3ffaadf2392f9 (diff) |
lib: construct compactor within try block to catch any exceptions
Constructors may also throw exceptions. Catch them.
Diffstat (limited to 'lib/database.cc')
-rw-r--r-- | lib/database.cc | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/database.cc b/lib/database.cc index 20e5ec23..3dfea0f4 100644 --- a/lib/database.cc +++ b/lib/database.cc @@ -864,7 +864,6 @@ notmuch_database_compact (const char* path, notmuch_compact_status_cb_t status_cb) { void *local = talloc_new (NULL); - NotmuchCompactor compactor(status_cb); char *notmuch_path, *xapian_path, *compact_xapian_path; char *old_xapian_path = NULL; notmuch_status_t ret = NOTMUCH_STATUS_SUCCESS; @@ -910,6 +909,8 @@ notmuch_database_compact (const char* path, } try { + NotmuchCompactor compactor(status_cb); + compactor.set_renumber(false); compactor.add_source(xapian_path); compactor.set_destdir(compact_xapian_path); |