g_key_file
- From: Kevin DeKorte <kdekorte gmail com>
- To: gtk-app-devel-list gnome org
- Subject: g_key_file
- Date: Sat, 13 Jan 2007 08:23:40 -0500
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Hi All,
I have an app that seemed to be working pretty well and then I added
support for updating a key_file every minute and all of a sudden my app
started leaking memory. I just want to make sure I'm not using the
key_file improperly. I seem to be losing about 100K per iteration of
this loop.
Here is the code
sunflower->emerald_theme = g_key_file_new();
g_key_file_load_from_file(sunflower->emerald_theme,
sunflower->filename,
G_KEY_FILE_KEEP_COMMENTS |
G_KEY_FILE_KEEP_TRANSLATIONS,
NULL);
if (y >= 0){
g_key_file_set_integer(sunflower->emerald_theme,"shadow","shadow_offset_x",x);
g_key_file_set_integer(sunflower->emerald_theme,"shadow","shadow_offset_y",y);
}
else
{
g_key_file_set_integer(sunflower->emerald_theme,"shadow","shadow_offset_x",5);
g_key_file_set_integer(sunflower->emerald_theme,"shadow","shadow_offset_y",5);
}
file = fopen(sunflower->filename,"w");
fprintf(file,"%s",g_key_file_to_data(sunflower->emerald_theme,NULL,NULL));
fclose(file);
g_key_file_free(sunflower->emerald_theme);
- --
Get my public GnuPG key from
http://pgp.mit.edu:11371/pks/lookup?op=get&search=0x7D0BD5D1
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org
iD8DBQFFqN1c6w2kMH0L1dERAhtcAKCKZYAcSZgOIiignEOXTgJfDa2mkQCggYEl
MkGrVOD8bWtTd425oc/IJpg=
=waPc
-----END PGP SIGNATURE-----
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]