Re: [Gtranslator-devel] GTR_FREE useful?



Ross Golder wrote:
I've just had to patch gtranslator in a couple of places, because of the
following error, which would be noticed by users of recent versions of
gcc (as I understand it):

bookmark.c: In function `gtranslator_bookmark_show_list':
bookmark.c:652: warning: use of cast expressions as lvalues is
deprecated

I'm trying to figure out what extra value is gained from using the
GTR_FREE macro, than just using plain g_free. Do we need to NULL the
pointer every time? Sounds like a dodgy workaround to prevent again
double-free'ing etc. but perhaps we should take it out and fix the
double-frees properly instead?


Yes, would be the right thing to do. I just introduced the GTR_ macros to save some typing and workaround the double freeing problems. I had tried to replace it with g_free but this happened to be a bad thing to do :-)

I'd crop it out and replace it with g_free and then to look into the crashy cases.




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]