Matthew Vanecek <[EMAIL PROTECTED]> writes: > I'm not sure if we should free the data nodes or not. It doesn't seem > to cause any problems, but that's not always a sure indicator of > appropriateness, is it? =P I tried to reason through it a bit and > somehow decided they should be freed. I think my thought was that since > we are calling g_list_free(blist), and that g_list_free() doesn't free > dynamically allocated node->data, we should do it explicitly. The > original (as you can see), simply called g_list_free() on be->blist, > which I guess is OK to leave that way... > > FWIW, g_free does allow a NULL argument.
It's not NULL that I'm worried about -- it's double-freeing the data. The PG BE doesn't own the QofBook*, so it shouldn't destroy it. Even worse, just g_free'ing it can do two things: 1) cause a double free, and 2) cause a memory leak. -derek -- Derek Atkins, SB '93 MIT EE, SM '95 MIT Media Laboratory Member, MIT Student Information Processing Board (SIPB) URL: http://web.mit.edu/warlord/ PP-ASEL-IA N1NWH [EMAIL PROTECTED] PGP key available _______________________________________________ gnucash-devel mailing list [EMAIL PROTECTED] http://www.gnucash.org/cgi-bin/mailman/listinfo/gnucash-devel