xfdesktop window-list menu patch

Olivier Fourdan fourdan at xfce.org
Wed Jan 22 23:57:52 CET 2003


Hi Jens,

Sorry, but the way you manage your strings isn't correct...

g_strdup allocates memory, it doesn't make much sense to use a char
array for that, you leak memory...

It's better to do :

gchar *my_string;

my_string=g_strdup(another_string);

/* so some processing with the string */

g_free(my_string);


=> this way, you don't leak memory. Can you try to make this patch a bit
cleaner ?

Note: It's usually a bad idea to use char arrays IMHO :)

Thanks in advance,

Cheers,
Olivier.

On Wed, 2003-01-22 at 23:44, Jens Luedicke wrote:
> Hi ...
> 
> I hacked some code to shorten the 
> window-titles in the window-list menu.
> 
> Its mainly basic C knowledge and ignores
> probably good and safe coding style ;)
-- 
Olivier Fourdan <fourdan at xfce.org>
http://www.xfce.org




More information about the Xfce4-dev mailing list