[pacman-dev] [PATCH 1/5] Two memleak fixes in pacman.

Nagy Gabor ngaba at bibl.u-szeged.hu
Mon Nov 19 13:43:49 EST 2007


> Obviously I'll apply this. However, from a design standpoint, I really
> wish we never had to call alpm_list_free() from the frontend on
> anything returned by the library. When we start having to do that, it
> leads to double frees and all sorts of other fun stuff.

I simply don't understand this. All known libraries _must_ use this when they
_compute_ something on request. The library simply doesn't know if the result is
still needed by the caller (front-end) or not. You may say we could implement
whatprovides_ready, but this is just equivalent with list_free (and ugly).
The main problem here, that we have no libalpm documentation where we could
define for front-ends which results should be freed and which should not.

Bye, ngaba


----------------------------------------------------
SZTE Egyetemi Könyvtár - http://www.bibl.u-szeged.hu
This mail sent through IMP: http://horde.org/imp/





More information about the pacman-dev mailing list