aboutsummaryrefslogtreecommitdiffstats
path: root/src/jpeg.c
diff options
context:
space:
mode:
authorJohn Hawthorn <jhawthor@uvic.ca>2008-06-25 16:20:40 -0700
committerJohn Hawthorn <jhawthor@uvic.ca>2008-06-25 16:20:40 -0700
commit45cf68a160f94d1091c3e5c69237505b138daf25 (patch)
tree33b3c29257f6f983b90174caeaa03f60c856de69 /src/jpeg.c
parent665c97078cfa687273e89c8b969d08f5290bcc01 (diff)
downloadmirror-meh-45cf68a160f94d1091c3e5c69237505b138daf25.tar.gz
mirror-meh-45cf68a160f94d1091c3e5c69237505b138daf25.tar.bz2
mirror-meh-45cf68a160f94d1091c3e5c69237505b138daf25.zip
added close method. Fixed all known memory leaks
Diffstat (limited to 'src/jpeg.c')
-rw-r--r--src/jpeg.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/jpeg.c b/src/jpeg.c
index ecefda9..797bdb4 100644
--- a/src/jpeg.c
+++ b/src/jpeg.c
@@ -92,13 +92,19 @@ static int jpeg_read(struct image *img){
}
}
jpeg_finish_decompress(&j->cinfo);
- jpeg_destroy_decompress(&j->cinfo);
return 0;
}
+void jpeg_close(struct image *img){
+ struct jpeg_t *j = (struct jpeg_t *)img;
+ jpeg_destroy_decompress(&j->cinfo);
+ fclose(j->f);
+}
+
struct imageformat libjpeg = {
jpeg_open,
- jpeg_read
+ jpeg_read,
+ jpeg_close
};