* [mesa PATCH] nouveau: fix winsys object leak
@ 2010-01-17 22:50 Marcin Slusarz
[not found] ` <20100117225050.GE14113-OI9uyE9O0yo@public.gmane.org>
0 siblings, 1 reply; 2+ messages in thread
From: Marcin Slusarz @ 2010-01-17 22:50 UTC (permalink / raw)
To: nouveau-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW
---
src/gallium/drivers/nouveau/nouveau_screen.c | 2 ++
.../winsys/drm/nouveau/drm/nouveau_drm_api.c | 9 +++++++++
2 files changed, 11 insertions(+), 0 deletions(-)
diff --git a/src/gallium/drivers/nouveau/nouveau_screen.c b/src/gallium/drivers/nouveau/nouveau_screen.c
index 7ebc94e..1ad539d 100644
--- a/src/gallium/drivers/nouveau/nouveau_screen.c
+++ b/src/gallium/drivers/nouveau/nouveau_screen.c
@@ -260,6 +260,8 @@ nouveau_screen_init(struct nouveau_screen *screen, struct nouveau_device *dev)
void
nouveau_screen_fini(struct nouveau_screen *screen)
{
+ struct pipe_winsys *ws = screen->base.winsys;
nouveau_channel_free(&screen->channel);
+ ws->destroy(ws);
}
diff --git a/src/gallium/winsys/drm/nouveau/drm/nouveau_drm_api.c b/src/gallium/winsys/drm/nouveau/drm/nouveau_drm_api.c
index 4b2c6a1..39b985c 100644
--- a/src/gallium/winsys/drm/nouveau/drm/nouveau_drm_api.c
+++ b/src/gallium/winsys/drm/nouveau/drm/nouveau_drm_api.c
@@ -54,6 +54,14 @@ static struct dri1_api nouveau_dri1_api = {
nouveau_dri1_front_surface,
};
+static void
+nouveau_drm_destroy_winsys(struct pipe_winsys *s)
+{
+ struct nouveau_winsys *nv_winsys = nouveau_winsys(s);
+ FREE(nv_winsys->pctx);
+ FREE(nv_winsys);
+}
+
static struct pipe_screen *
nouveau_drm_create_screen(struct drm_api *api, int fd,
struct drm_create_screen_arg *arg)
@@ -105,6 +113,7 @@ nouveau_drm_create_screen(struct drm_api *api, int fd,
return NULL;
}
ws = &nvws->base;
+ ws->destroy = nouveau_drm_destroy_winsys;
nvws->pscreen = init(ws, dev);
if (!nvws->pscreen) {
--
1.6.6
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2010-01-24 18:22 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-01-17 22:50 [mesa PATCH] nouveau: fix winsys object leak Marcin Slusarz
[not found] ` <20100117225050.GE14113-OI9uyE9O0yo@public.gmane.org>
2010-01-24 18:22 ` Marcin Slusarz
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.