]> Pileus Git - ~andy/gtk/blobdiff - demos/gtk-demo/pixbufs.c
Replace a lot of idle and timeout calls by the new gdk_threads api.
[~andy/gtk] / demos / gtk-demo / pixbufs.c
index 1bfa2662ce025066d2556d18be15cd9f34729f33..5fad5aa7f7a84cd0520bf7bd9c2385a07f83a162 100644 (file)
@@ -12,7 +12,6 @@
  *
  */
 
-#include <config.h>
 #include <stdlib.h>
 #include <gtk/gtk.h>
 #include <math.h>
@@ -62,7 +61,7 @@ load_pixbufs (GError **error)
   if (background)
     return TRUE; /* already loaded earlier */
 
-  /* demo_find_file() looks in the the current directory first,
+  /* demo_find_file() looks in the current directory first,
    * so you can run gtk-demo without installing GTK, then looks
    * in the location where the file is installed.
    */
@@ -188,7 +187,9 @@ timeout (gpointer data)
                               : MAX (127, fabs (255 * cos (f * 2.0 * G_PI)))));
     }
 
+  GDK_THREADS_ENTER ();
   gtk_widget_queue_draw (da);
+  GDK_THREADS_LEAVE ();
 
   frame_num++;
   return TRUE;
@@ -265,6 +266,7 @@ do_pixbufs (GtkWidget *do_widget)
     {
       gtk_widget_destroy (window);
       window = NULL;
+      g_object_unref (frame);
     }
 
   return window;