unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
* [PATCH] lib: fix memory leak of field processor objects
@ 2016-06-10  2:37 David Bremner
  2016-06-10 11:13 ` Tomi Ollila
  2016-06-11 16:22 ` David Bremner
  0 siblings, 2 replies; 3+ messages in thread
From: David Bremner @ 2016-06-10  2:37 UTC (permalink / raw)
  To: notmuch

The field processor objects need to be deallocated explicitly just like
the range processors (or a talloc destructor defined).
---
 lib/database.cc | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/lib/database.cc b/lib/database.cc
index 2b2d821..afafe88 100644
--- a/lib/database.cc
+++ b/lib/database.cc
@@ -1107,6 +1107,13 @@ notmuch_database_close (notmuch_database_t *notmuch)
     delete notmuch->last_mod_range_processor;
     notmuch->last_mod_range_processor = NULL;
 
+#if HAVE_XAPIAN_FIELD_PROCESSOR
+    delete notmuch->date_field_processor;
+    notmuch->date_field_processor = NULL;
+    delete notmuch->query_field_processor;
+    notmuch->query_field_processor = NULL;
+#endif
+
     return status;
 }
 
-- 
2.8.1

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] lib: fix memory leak of field processor objects
  2016-06-10  2:37 [PATCH] lib: fix memory leak of field processor objects David Bremner
@ 2016-06-10 11:13 ` Tomi Ollila
  2016-06-11 16:22 ` David Bremner
  1 sibling, 0 replies; 3+ messages in thread
From: Tomi Ollila @ 2016-06-10 11:13 UTC (permalink / raw)
  To: David Bremner, notmuch

On Fri, Jun 10 2016, David Bremner <david@tethera.net> wrote:

> The field processor objects need to be deallocated explicitly just like
> the range processors (or a talloc destructor defined).
> ---
>  lib/database.cc | 7 +++++++
>  1 file changed, 7 insertions(+)
>
> diff --git a/lib/database.cc b/lib/database.cc
> index 2b2d821..afafe88 100644
> --- a/lib/database.cc
> +++ b/lib/database.cc
> @@ -1107,6 +1107,13 @@ notmuch_database_close (notmuch_database_t *notmuch)
>      delete notmuch->last_mod_range_processor;
>      notmuch->last_mod_range_processor = NULL;
>  
> +#if HAVE_XAPIAN_FIELD_PROCESSOR
> +    delete notmuch->date_field_processor;
> +    notmuch->date_field_processor = NULL;
> +    delete notmuch->query_field_processor;
> +    notmuch->query_field_processor = NULL;
> +#endif
> +

... ok, it was this I marked trivial and not the one I wrote in
id:m2r3c5ti1c.fsf@guru.guru-group.fi (the same thought about triviality may
apply, though)


>      return status;
>  }
>  
> -- 
> 2.8.1

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] lib: fix memory leak of field processor objects
  2016-06-10  2:37 [PATCH] lib: fix memory leak of field processor objects David Bremner
  2016-06-10 11:13 ` Tomi Ollila
@ 2016-06-11 16:22 ` David Bremner
  1 sibling, 0 replies; 3+ messages in thread
From: David Bremner @ 2016-06-11 16:22 UTC (permalink / raw)
  To: notmuch

David Bremner <david@tethera.net> writes:

> The field processor objects need to be deallocated explicitly just like
> the range processors (or a talloc destructor defined).

pushed to master

d

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2016-06-11 16:22 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-06-10  2:37 [PATCH] lib: fix memory leak of field processor objects David Bremner
2016-06-10 11:13 ` Tomi Ollila
2016-06-11 16:22 ` David Bremner

Code repositories for project(s) associated with this public inbox

	https://yhetil.org/notmuch.git/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).