From a7debae6f98e20704897d8a61d992a3fdb5fdd69 Mon Sep 17 00:00:00 2001 From: Sam Hocevar Date: Mon, 26 Nov 2007 01:04:34 +0000 Subject: [PATCH] * Fix memory leaks that slipped in here and there. We still have 100,000 fewer than Firefox, lol. --- cucul/cucul.c | 2 ++ cxx/cxxtest.cpp | 1 + test/event.c | 1 + test/gamma.c | 2 ++ 4 files changed, 6 insertions(+) diff --git a/cucul/cucul.c b/cucul/cucul.c index 9a976f2..91ccc0b 100644 --- a/cucul/cucul.c +++ b/cucul/cucul.c @@ -128,6 +128,8 @@ int cucul_manage_canvas(cucul_canvas_t *cv, int (*callback)(void *), void *p) return -1; } + cv->resize_callback = callback; + cv->resize_data = p; cv->refcount = 1; return 0; diff --git a/cxx/cxxtest.cpp b/cxx/cxxtest.cpp index 64ec2b1..3262fcf 100644 --- a/cxx/cxxtest.cpp +++ b/cxx/cxxtest.cpp @@ -106,6 +106,7 @@ int main(int argc, char *argv[]) } delete dp; + delete pig; delete cv; return 0; diff --git a/test/event.c b/test/event.c index e2c6a9b..e9da747 100644 --- a/test/event.c +++ b/test/event.c @@ -111,6 +111,7 @@ int main(int argc, char **argv) } /* Clean up */ + free(events); caca_free_display(dp); cucul_free_canvas(cv); diff --git a/test/gamma.c b/test/gamma.c index 3199c02..c9cb357 100644 --- a/test/gamma.c +++ b/test/gamma.c @@ -122,6 +122,8 @@ int main(int argc, char *argv[]) cucul_free_dither(right); caca_free_display(dp); + cucul_free_canvas(mask); + cucul_free_canvas(cw); cucul_free_canvas(cv); return 0;