diff options
author | Cyrille Bagard <nocbos@gmail.com> | 2017-01-03 22:17:47 (GMT) |
---|---|---|
committer | Cyrille Bagard <nocbos@gmail.com> | 2017-01-03 22:17:47 (GMT) |
commit | 539a8247acabfba21bbcb20ff14793f92ba34d4c (patch) | |
tree | 774bc987f5ba38f4414b55f2bdaffc8c328cb7d5 /src/glibext | |
parent | 2f0c162313fa7272bfec7eb674b71e5e15c4ec7c (diff) |
Deleted lines from memory as expected.
Diffstat (limited to 'src/glibext')
-rw-r--r-- | src/glibext/gbuffercache.c | 32 |
1 files changed, 26 insertions, 6 deletions
diff --git a/src/glibext/gbuffercache.c b/src/glibext/gbuffercache.c index 37a9492..926d034 100644 --- a/src/glibext/gbuffercache.c +++ b/src/glibext/gbuffercache.c @@ -87,6 +87,9 @@ static void on_line_ref_toggle(cache_info *, GBufferLine *, gboolean); static GBufferLine *get_cache_info_line(cache_info *, size_t); /* Force la réinitialisation d'une éventuelle ligne cachée. */ +static void _reset_cache_info_line_unlocked(cache_info *); + +/* Force la réinitialisation d'une éventuelle ligne cachée. */ static void reset_cache_info_line(cache_info *); @@ -396,7 +399,7 @@ static void on_line_ref_toggle(cache_info *info, GBufferLine *line, gboolean las assert(info->line != NULL); - info->line = NULL; + _reset_cache_info_line_unlocked(info); G_UNLOCK(_line_update); @@ -466,20 +469,37 @@ static GBufferLine *get_cache_info_line(cache_info *info, size_t index) * * ******************************************************************************/ -static void reset_cache_info_line(cache_info *info) +static void _reset_cache_info_line_unlocked(cache_info *info) { - G_LOCK(_line_update); - if (info->line != NULL) { g_object_remove_toggle_ref(G_OBJECT(info->line), (GToggleNotify)on_line_ref_toggle, info); - g_object_unref(G_OBJECT(info->line)); - info->line = NULL; } +} + + +/****************************************************************************** +* * +* Paramètres : info = informations sur une ligne à venir manipuler. * +* * +* Description : Force la réinitialisation d'une éventuelle ligne cachée. * +* * +* Retour : - * +* * +* Remarques : - * +* * +******************************************************************************/ + +static void reset_cache_info_line(cache_info *info) +{ + G_LOCK(_line_update); + + _reset_cache_info_line_unlocked(info); + G_UNLOCK(_line_update); } |