diff --git a/gtk/torrent-inspector.c b/gtk/torrent-inspector.c index bf0576ea2..c20ae5fcb 100644 --- a/gtk/torrent-inspector.c +++ b/gtk/torrent-inspector.c @@ -108,8 +108,6 @@ refresh_pieces (GtkWidget * da, GdkEventExpose * event UNUSED, gpointer gtor) GdkGC **gcs = (GdkGC**) g_object_get_data (G_OBJECT(da), "graphics-contexts"); if (gcs == NULL) { - gcs = g_new (GdkGC*, N_COLORS+1); - const GdkColor colors [N_COLORS] = { RGB_2_GDK ( 0, 226, 255 ), /* all */ RGB_2_GDK ( 0, 153, 204 ), /* lots */ @@ -121,6 +119,8 @@ refresh_pieces (GtkWidget * da, GdkEventExpose * event UNUSED, gpointer gtor) RGB_2_GDK ( 255, 164, 0 ), /* blink - orange */ }; + gcs = g_new (GdkGC*, N_COLORS+1); + for (i=0; iwindow); gdk_gc_set_colormap (gcs[i], colormap);