[cvs] bogofilter/src datastore.c,1.73,1.74

Matthias Andree matthias.andree at gmx.de
Wed Mar 23 09:28:40 CET 2005


David Relson <relson at users.sourceforge.net> writes:

> @@ -393,7 +393,7 @@
>  /* Cleanup storage allocation */
>  void ds_cleanup(void *dbe)
>  {
> -    if (dsm && dsm->dsm_cleanup)
> +    if (dsm != NULL && dsm->dsm_cleanup)
>  	dsm->dsm_cleanup(dbe);
>      xfree(msg_count_tok);
>      xfree(wordlist_version_tok);

OK. Keeping the if dsm->dsm_cleanup here is essential,
as the SQLite driver doesn't a cleanup function.

My idea was to let the driver only define those functions it really
offers and let datastore.c ignore others (as a model of virtual
functions that are only defined if there is support in the back-end,
think non-pure C++ virtual function model).

The other code (checking if dsm->dsm_begin is defined) was proactively
added to unify the whole datastore handling across all datastores so
we'd have a dsm for all datastore drivers - this would allow us to get
rid of the dummy functions in the long run.

-- 
Matthias Andree
_______________________________________________
Bogofilter-dev mailing list
Bogofilter-dev at bogofilter.org
http://www.bogofilter.org/mailman/listinfo/bogofilter-dev



More information about the bogofilter-dev mailing list