From ecf8bb62c0c83d6effc398a192ca8acdae148a67 Mon Sep 17 00:00:00 2001 From: "Leandro A. F. Pereira" Date: Sat, 10 Jan 2009 11:15:43 -0200 Subject: Fix segfault --- hardinfo2/util.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'hardinfo2/util.c') diff --git a/hardinfo2/util.c b/hardinfo2/util.c index 28d51635..d2954573 100644 --- a/hardinfo2/util.c +++ b/hardinfo2/util.c @@ -116,9 +116,11 @@ void widget_set_cursor(GtkWidget * widget, GdkCursorType cursor_type) { GdkCursor *cursor; - cursor = gdk_cursor_new(cursor_type); - gdk_window_set_cursor(GDK_WINDOW(widget->window), cursor); - gdk_cursor_unref(cursor); + if ((cursor = gdk_cursor_new(cursor_type))) { + gdk_window_set_cursor(GDK_WINDOW(widget->window), cursor); + gdk_display_flush(gtk_widget_get_display(widget)); + gdk_cursor_unref(cursor); + } while (gtk_events_pending()) gtk_main_iteration(); -- cgit v1.2.3