diff options
author | Tom Stellard <[email protected]> | 2014-05-08 21:08:32 -0400 |
---|---|---|
committer | Tom Stellard <[email protected]> | 2014-05-09 04:33:03 -0400 |
commit | c5f0c98c49a78777b2564a53028e345195ef275f (patch) | |
tree | 2695c687c0f60f58d152ec09f3f396d9e7bc3040 /src/gallium/state_trackers/clover | |
parent | c650033b863c3ac8388ff1b192b476f63cf81202 (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" <[email protected]>
Reviewed-by: Francisco Jerez <[email protected]>
Diffstat (limited to 'src/gallium/state_trackers/clover')
-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() { |