From e22217ff9a0e990b3f3c08e861836c8537a84f59 Mon Sep 17 00:00:00 2001 From: caro Date: Sat, 18 Sep 2010 23:17:27 +0000 Subject: [PATCH] free the main region (leak--) git-svn-id: svn+ssh://svn.enlightenment.org/var/svn/e/trunk/evas@52429 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33 --- src/modules/engines/software_gdi/evas_engine.h | 1 + src/modules/engines/software_gdi/evas_gdi_main.c | 2 ++ src/modules/engines/software_gdi/evas_outbuf.c | 7 ++++--- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/modules/engines/software_gdi/evas_engine.h b/src/modules/engines/software_gdi/evas_engine.h index 33c9f4c..b8ddc85 100644 --- a/src/modules/engines/software_gdi/evas_engine.h +++ b/src/modules/engines/software_gdi/evas_engine.h @@ -69,6 +69,7 @@ struct _Outbuf BITMAPINFO_GDI *bitmap_info; HWND window; HDC dc; + HRGN regions; int depth; unsigned char borderless : 1; unsigned char fullscreen : 1; diff --git a/src/modules/engines/software_gdi/evas_gdi_main.c b/src/modules/engines/software_gdi/evas_gdi_main.c index 8b7ddea..4a63959 100644 --- a/src/modules/engines/software_gdi/evas_gdi_main.c +++ b/src/modules/engines/software_gdi/evas_gdi_main.c @@ -87,6 +87,8 @@ evas_software_gdi_shutdown(Outbuf *buf) free(buf->priv.gdi.bitmap_info); ReleaseDC(buf->priv.gdi.window, buf->priv.gdi.dc); + if (buf->priv.gdi.regions) + DeleteObject(buf->priv.gdi.regions); } void diff --git a/src/modules/engines/software_gdi/evas_outbuf.c b/src/modules/engines/software_gdi/evas_outbuf.c index e260f82..6841baa 100644 --- a/src/modules/engines/software_gdi/evas_outbuf.c +++ b/src/modules/engines/software_gdi/evas_outbuf.c @@ -408,8 +408,9 @@ evas_software_gdi_outbuf_push_updated_region(Outbuf *buf, /* Region code */ if (!buf->priv.gdi.region) { - if (regions) - DeleteObject(regions); + if (buf->priv.gdi.regions) + DeleteObject(buf->priv.gdi.regions); + buf->priv.gdi.regions = NULL; SetWindowRgn(buf->priv.gdi.window, NULL, 1); return; } @@ -434,7 +435,6 @@ evas_software_gdi_outbuf_push_updated_region(Outbuf *buf, ww = rect.right - rect.left; wh = rect.bottom - rect.top; - printf ("(%d,%d) (%d,%d)\n", w, h, ww, wh); if (!GetWindowRect(buf->priv.gdi.window, &rect)) return; @@ -554,6 +554,7 @@ evas_software_gdi_outbuf_push_updated_region(Outbuf *buf, if (regions) SetWindowRgn(buf->priv.gdi.window, regions, 1); + buf->priv.gdi.regions = regions; buf->priv.region_built = 1; } -- 2.7.4