summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJosé Fonseca <jfonseca@vmware.com>2009-02-17 21:53:40 +0000
committerJosé Fonseca <jfonseca@vmware.com>2009-02-18 11:17:06 +0000
commit673d01eda9662f6cc984f2a1b608a875271d2a29 (patch)
treeef7684e78256ef0bb3f50369fbef769ab31e0576
parentc706ea4f454b5885d9dc71a605853ee21e527285 (diff)
wgl: Report memory leaks.
-rw-r--r--src/gallium/state_trackers/wgl/shared/stw_device.c10
-rw-r--r--src/gallium/state_trackers/wgl/shared/stw_device.h4
2 files changed, 14 insertions, 0 deletions
diff --git a/src/gallium/state_trackers/wgl/shared/stw_device.c b/src/gallium/state_trackers/wgl/shared/stw_device.c
index 6873e813ee..903606b425 100644
--- a/src/gallium/state_trackers/wgl/shared/stw_device.c
+++ b/src/gallium/state_trackers/wgl/shared/stw_device.c
@@ -66,6 +66,10 @@ stw_shared_init(const struct stw_winsys *stw_winsys)
stw_dev = &stw_dev_storage;
memset(stw_dev, 0, sizeof(*stw_dev));
+#ifdef DEBUG
+ stw_dev->memdbg_no = debug_memory_begin();
+#endif
+
stw_dev->stw_winsys = stw_winsys;
stw_dev->screen = stw_winsys->create_screen();
@@ -87,5 +91,11 @@ error1:
void
stw_shared_cleanup(void)
{
+ if(stw_dev) {
+#ifdef DEBUG
+ debug_memory_end(stw_dev->memdbg_no);
+#endif
+ }
+
stw_dev = NULL;
}
diff --git a/src/gallium/state_trackers/wgl/shared/stw_device.h b/src/gallium/state_trackers/wgl/shared/stw_device.h
index bc0bce37c6..c1e041212b 100644
--- a/src/gallium/state_trackers/wgl/shared/stw_device.h
+++ b/src/gallium/state_trackers/wgl/shared/stw_device.h
@@ -35,6 +35,10 @@ struct stw_device
{
const struct stw_winsys *stw_winsys;
struct pipe_screen *screen;
+
+#ifdef DEBUG
+ unsigned long memdbg_no;
+#endif
};