Commit 66779b9b authored by Federico Mena Quintero's avatar Federico Mena Quintero Committed by Arturo Espinosa
Browse files

Set the initial ref_count to 1.

1999-09-17  Federico Mena Quintero  <federico@redhat.com>

	* src/io-bmp.c (image_load): Set the initial ref_count to 1.

	* src/io-gif.c (image_load): Likewise.

	* src/io-jpeg.c (image_load): Likewise.

	* src/io-png.c (image_load): Likewise.

	* src/io-tiff.c (image_load): Likewise.

	* src/io-xpm.c (_pixbuf_create_from_xpm): Likewise.

	* src/gdk-pixbuf-io.c (gdk_pixbuf_load_image): Added an assertion
	for the ref_count to be != 0.
parent 6fce115b
1999-09-17 Federico Mena Quintero <federico@redhat.com>
* src/io-bmp.c (image_load): Set the initial ref_count to 1.
* src/io-gif.c (image_load): Likewise.
* src/io-jpeg.c (image_load): Likewise.
* src/io-png.c (image_load): Likewise.
* src/io-tiff.c (image_load): Likewise.
* src/io-xpm.c (_pixbuf_create_from_xpm): Likewise.
* src/gdk-pixbuf-io.c (gdk_pixbuf_load_image): Added an assertion
for the ref_count to be != 0.
* src/gdk-pixbuf.c (gdk_pixbuf_ref): Be more paranoid with sanity
checking.
(gdk_pixbuf_unref): Fix incorrect sanity check and comparison.
......
......@@ -194,6 +194,7 @@ gdk_pixbuf_load_image (const char *file)
fseek(f, 0, SEEK_SET);
pixbuf = (*file_formats [i].load)(f);
fclose (f);
g_assert (pixbuf->ref_count != 0);
return pixbuf;
}
}
......
......@@ -47,7 +47,7 @@ GdkPixBuf *image_load(FILE * f)
/* Ok, I'm anal...shoot me */
if (!(pixbuf->art_pixbuf))
return NULL;
pixbuf->ref_count = 0;
pixbuf->ref_count = 1;
pixbuf->unref_func = NULL;
return pixbuf;
......
......@@ -174,7 +174,7 @@ GdkPixBuf *image_load(FILE * f)
return NULL;
}
pixbuf->ref_count = 0;
pixbuf->ref_count = 1;
pixbuf->unref_func = NULL;
return pixbuf;
......
......@@ -121,7 +121,7 @@ GdkPixBuf *image_load(FILE *f)
g_free(pixbuf);
return NULL;
}
pixbuf->ref_count = 0;
pixbuf->ref_count = 1;
pixbuf->unref_func = NULL;
return pixbuf;
......
......@@ -158,7 +158,7 @@ GdkPixBuf *image_load(FILE * f)
return NULL;
}
pixbuf->ref_count = 0;
pixbuf->ref_count = 1;
pixbuf->unref_func = NULL;
return pixbuf;
......
......@@ -94,7 +94,7 @@ GdkPixBuf *image_load(FILE * f)
/* Ok, I'm anal...shoot me */
if (!(pixbuf->art_pixbuf))
return NULL;
pixbuf->ref_count = 0;
pixbuf->ref_count = 1;
pixbuf->unref_func = NULL;
return pixbuf;
......
......@@ -417,7 +417,7 @@ static GdkPixBuf *
return NULL;
}
pixbuf->ref_count = 0;
pixbuf->ref_count = 1;
pixbuf->unref_func = NULL;
return pixbuf;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment