mirror of
https://git.notmuchmail.org/git/notmuch
synced 2024-11-22 02:48:08 +01:00
CLI/reindex: fix memory leak
Since message is owned by messages, it was held for the entire run of the program. This in turn means that the Xapian::Document objects are not freed, and thus one ends up with (effectively) a copy of one's entire mailstore in memory when running notmuch reindex '*' Thanks to Olly Betts for the patient help debugging, and the suggestion of a fix.
This commit is contained in:
parent
319dd95ebb
commit
08cd2e57bb
1 changed files with 1 additions and 0 deletions
|
@ -71,6 +71,7 @@ reindex_query (notmuch_database_t *notmuch, const char *query_string,
|
||||||
ret = notmuch_message_reindex(message, indexopts);
|
ret = notmuch_message_reindex(message, indexopts);
|
||||||
if (ret != NOTMUCH_STATUS_SUCCESS)
|
if (ret != NOTMUCH_STATUS_SUCCESS)
|
||||||
break;
|
break;
|
||||||
|
notmuch_message_destroy (message);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!ret)
|
if (!ret)
|
||||||
|
|
Loading…
Reference in a new issue