Complete.Org: Mailing Lists: Archives: freeciv-dev: February 2005:
[Freeciv-Dev] (PR#12112) assertion `width > 0' failed
Home

[Freeciv-Dev] (PR#12112) assertion `width > 0' failed

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: brett.albertson@xxxxxxxxxxxx
Subject: [Freeciv-Dev] (PR#12112) assertion `width > 0' failed
From: "Jason Short" <jdorje@xxxxxxxxxxxxxxxxxxxxx>
Date: Fri, 4 Feb 2005 22:52:00 -0800
Reply-to: bugs@xxxxxxxxxxx

<URL: http://bugs.freeciv.org/Ticket/Display.html?id=12112 >

> [bretta - Fri Feb 04 20:19:56 2005]:
> 
> I'm getting some assertions in the GTK2 client on Solaris (Sparc).  I'm
> running the current CVS HEAD.
> 
> (civclient:1101): GdkPixbuf-CRITICAL **: file gdk-pixbuf-data.c: line
> 61: assertion `width > 0' failed

> I'm pretty sure this happened when I clicked on the "players" tab.

My mistake.  Here's a fix.

-jason

? blend.png
? fog
? fog.c
? fog.png
? foo
? terrain1.png
Index: client/gui-gtk-2.0/plrdlg.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/gui-gtk-2.0/plrdlg.c,v
retrieving revision 1.49
diff -u -r1.49 plrdlg.c
--- client/gui-gtk-2.0/plrdlg.c 1 Feb 2005 01:08:45 -0000       1.49
+++ client/gui-gtk-2.0/plrdlg.c 5 Feb 2005 06:49:55 -0000
@@ -476,7 +476,7 @@
 static GdkPixbuf *get_flag(struct nation_type *nation)
 {
   int x0, y0, x1, y1, w, h;
-  GdkPixbuf *im;
+  GdkPixbuf *im, *im2;
   SPRITE *flag;
 
   flag = nation->flag_sprite;
@@ -497,11 +497,11 @@
 
   /* croping */
   im = gdk_pixbuf_new_subpixbuf(sprite_get_pixbuf(flag), x0, y0, w, h);
+  im2 = gdk_pixbuf_copy(im);
   g_object_unref(im);
-  im = gdk_pixbuf_copy(im);
 
   /* and finaly store the scaled flag pixbuf in the static flags array */
-  return im;
+  return im2;
 }
 
 

[Prev in Thread] Current Thread [Next in Thread]