diff options
author | Cyrille Bagard <nocbos@gmail.com> | 2020-09-21 22:23:47 (GMT) |
---|---|---|
committer | Cyrille Bagard <nocbos@gmail.com> | 2020-09-21 22:23:47 (GMT) |
commit | 76fb13178cf6be94b8e01675b37f7cb1b92f7709 (patch) | |
tree | a6e6bbc6dde169add608097ceb5658fcb904bd08 /src/gtkext | |
parent | dfe76faf21e254c02c86a1b0b1f8ca8fc07fe027 (diff) |
Defined lock mechanism for buffer caches.
Diffstat (limited to 'src/gtkext')
-rw-r--r-- | src/gtkext/hexdisplay.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/gtkext/hexdisplay.c b/src/gtkext/hexdisplay.c index ea662ae..49da03a 100644 --- a/src/gtkext/hexdisplay.c +++ b/src/gtkext/hexdisplay.c @@ -324,6 +324,8 @@ static void gtk_hex_display_populate_cache(GtkHexDisplay *display) /* Adaptation du tampon interne */ + g_buffer_cache_wlock(display->cache); + count = g_buffer_cache_count_lines(display->cache); if (needed < count) @@ -332,6 +334,8 @@ static void gtk_hex_display_populate_cache(GtkHexDisplay *display) else if (needed > count) g_buffer_cache_extend_with(display->cache, needed, G_LINE_GENERATOR(display->generator)); + g_buffer_cache_wunlock(display->cache); + if (needed != count) gtk_widget_queue_resize(GTK_WIDGET(display)); |