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>
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() {