From: Ramakrishnan Muthukrishnan Date: Sat, 29 Jul 2023 17:50:22 +0000 (+0530) Subject: obtain display mutex while painting the pixbuf X-Git-Url: https://git.rkrishnan.org/Site/Content/Exhibitors/nxhtml.html?a=commitdiff_plain;h=2f0d7300ebd0e3ba8f466a661c51d71f671dce91;p=pihpsdr.git obtain display mutex while painting the pixbuf --- diff --git a/waterfall.c b/waterfall.c index 03e133f..f17224b 100644 --- a/waterfall.c +++ b/waterfall.c @@ -78,8 +78,10 @@ static gboolean waterfall_configure_event_cb(GtkWidget *widget, static gboolean waterfall_draw_cb(GtkWidget *widget, cairo_t *cr, gpointer data) { RECEIVER *rx = (RECEIVER *)data; + g_mutex_lock(&rx->display_mutex); gdk_cairo_set_source_pixbuf(cr, rx->pixbuf, 0, 0); cairo_paint(cr); + g_mutex_unlock(&rx->display_mutex); return FALSE; } @@ -108,7 +110,6 @@ static gboolean waterfall_scroll_event_cb(GtkWidget *widget, } void waterfall_update(RECEIVER *rx) { - int i; float *samples;