wgl: Report memory leaks.

This commit is contained in:
José Fonseca 2009-02-17 21:53:40 +00:00
parent c706ea4f45
commit 673d01eda9
2 changed files with 14 additions and 0 deletions

View File

@ -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;
}

View File

@ -35,6 +35,10 @@ struct stw_device
{
const struct stw_winsys *stw_winsys;
struct pipe_screen *screen;
#ifdef DEBUG
unsigned long memdbg_no;
#endif
};