aboutsummaryrefslogtreecommitdiffstats
path: root/src/main.c
diff options
context:
space:
mode:
authorJohn Hawthorn <jhawthor@uvic.ca>2008-06-24 23:54:54 -0700
committerJohn Hawthorn <jhawthor@uvic.ca>2008-06-24 23:54:54 -0700
commitae22db5d707dd2728bbdf4d2f70d7d9285017024 (patch)
tree56f5fa0aec8e3a5d10ad582bc080658115f23a66 /src/main.c
parent29510850182646a62d7969641edd8265a8cfc7ac (diff)
downloadmirror-meh-ae22db5d707dd2728bbdf4d2f70d7d9285017024.tar.gz
mirror-meh-ae22db5d707dd2728bbdf4d2f70d7d9285017024.tar.bz2
mirror-meh-ae22db5d707dd2728bbdf4d2f70d7d9285017024.zip
cleanup
Diffstat (limited to 'src/main.c')
-rw-r--r--src/main.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/main.c b/src/main.c
index 9a45508..c5ddd98 100644
--- a/src/main.c
+++ b/src/main.c
@@ -89,6 +89,7 @@ void run(){
const char *filename = direction();
int width = 0, height = 0;
struct image *img = NULL;
+ XImage *ximg = NULL;
int redraw = 0;
FILE *f = NULL;
@@ -106,6 +107,9 @@ void run(){
width = event.xconfigure.width;
height = event.xconfigure.height;
redraw = 1;
+ if(ximg)
+ XDestroyImage(ximg);
+ ximg = NULL;
/* Some window managers need reminding */
if(img)
@@ -138,6 +142,9 @@ void run(){
free(img->buf);
free(img);
}
+ if(ximg)
+ XDestroyImage(ximg);
+ ximg = NULL;
img = NULL;
redraw = 1;
break;
@@ -188,7 +195,8 @@ void run(){
}
continue; /* Allow for some events to be read, read is slow */
}
- drawimage(img, width, height);
+ ximg = getimage(img, width, height);
+ drawimage(ximg, width, height);
redraw = 0;
}
}