diff options
author | Emil Velikov <[email protected]> | 2015-10-17 20:53:16 +0100 |
---|---|---|
committer | Emil Velikov <[email protected]> | 2015-11-21 12:52:19 +0000 |
commit | 46991ab9aac99c5ba55b735396f32447e75a6320 (patch) | |
tree | b8b2fca8ed53de1770723945e8d2e2e87f710d53 /src | |
parent | d54ca54faa2a6dde3c4d2125fd41d10dfcf2f91e (diff) |
pipe-loader: teardown the winsys, if create_screen fails
i.e. plug some (hard to hit) memory leaks.
v2: fix rebase fallout - really teardown the winsys (Brian)
Signed-off-by: Emil Velikov <[email protected]>
Acked-by: Rob Clark <[email protected]>
Diffstat (limited to 'src')
-rw-r--r-- | src/gallium/auxiliary/pipe-loader/pipe_loader_sw.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/gallium/auxiliary/pipe-loader/pipe_loader_sw.c b/src/gallium/auxiliary/pipe-loader/pipe_loader_sw.c index 816ff1c85d3..85e06d312ed 100644 --- a/src/gallium/auxiliary/pipe-loader/pipe_loader_sw.c +++ b/src/gallium/auxiliary/pipe-loader/pipe_loader_sw.c @@ -240,8 +240,13 @@ static struct pipe_screen * pipe_loader_sw_create_screen(struct pipe_loader_device *dev) { struct pipe_loader_sw_device *sdev = pipe_loader_sw_device(dev); + struct pipe_screen *screen; - return sdev->dd->create_screen(sdev->ws); + screen = sdev->dd->create_screen(sdev->ws); + if (!screen) + sdev->ws->destroy(sdev->ws); + + return screen; } static struct pipe_loader_ops pipe_loader_sw_ops = { |