]> git.rkrishnan.org Git - pihpsdr.git/commitdiff
obtain display mutex while painting the pixbuf
authorRamakrishnan Muthukrishnan <ram@rkrishnan.org>
Sat, 29 Jul 2023 17:50:22 +0000 (23:20 +0530)
committerRamakrishnan Muthukrishnan <ram@rkrishnan.org>
Sat, 29 Jul 2023 17:50:22 +0000 (23:20 +0530)
waterfall.c

index 03e133fc489415642b14e09b9f2cc3fbdf3796ad..f17224b5dd53001c6f2b469ed36de30212dcc4d7 100644 (file)
@@ -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;