diff options
author | Tom Stellard <thomas.stellard@amd.com> | 2014-05-08 21:08:32 -0400 |
---|---|---|
committer | Ian Romanick <ian.d.romanick@intel.com> | 2014-05-09 20:10:37 -0700 |
commit | e29daf82cc3a0706305e1ba80ed587023910d5ac (patch) | |
tree | 5963213d851b450b8c762b9fbde6bc8f3489e78c /src/gallium/state_trackers | |
parent | 03673bcf6c66cbcaece48eecb0766e1e2b77f9fa (diff) |
clover: Destory pipe_screen when device does not support compute v2
v2:
- Make sure screen was successfully created before destroying it.
Cc: "10.2" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
(cherry picked from commit c5f0c98c49a78777b2564a53028e345195ef275f)
Diffstat (limited to 'src/gallium/state_trackers')
-rw-r--r-- | src/gallium/state_trackers/clover/core/device.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/gallium/state_trackers/clover/core/device.cpp b/src/gallium/state_trackers/clover/core/device.cpp index 2f84677b54e..bc3e3e68a5e 100644 --- a/src/gallium/state_trackers/clover/core/device.cpp +++ b/src/gallium/state_trackers/clover/core/device.cpp @@ -42,8 +42,11 @@ namespace { device::device(clover::platform &platform, pipe_loader_device *ldev) : platform(platform), ldev(ldev) { pipe = pipe_loader_create_screen(ldev, PIPE_SEARCH_DIR); - if (!pipe || !pipe->get_param(pipe, PIPE_CAP_COMPUTE)) + if (!pipe || !pipe->get_param(pipe, PIPE_CAP_COMPUTE)) { + if (pipe) + pipe->destroy(pipe); throw error(CL_INVALID_DEVICE); + } } device::~device() { |