mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-05 03:08:05 +02:00
api/icd: drop static lifetime from get_ref return type
This was never correct as the object pointed to can be destroyed at any moment. Signed-off-by: Karol Herbst <git@karolherbst.de> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24061>
This commit is contained in:
parent
d653eb8a9a
commit
2c48ce81a8
1 changed files with 3 additions and 3 deletions
|
|
@ -231,7 +231,7 @@ pub trait ReferenceCountedAPIPointer<T, const ERR: i32> {
|
|||
}
|
||||
}
|
||||
|
||||
fn get_ref(&self) -> CLResult<&'static T> {
|
||||
fn get_ref(&self) -> CLResult<&T> {
|
||||
unsafe { Ok(self.get_ptr()?.as_ref().unwrap()) }
|
||||
}
|
||||
|
||||
|
|
@ -272,9 +272,9 @@ pub trait ReferenceCountedAPIPointer<T, const ERR: i32> {
|
|||
Ok(res)
|
||||
}
|
||||
|
||||
fn get_ref_vec_from_arr(objs: *const Self, count: u32) -> CLResult<Vec<&'static T>>
|
||||
fn get_ref_vec_from_arr<'a>(objs: *const Self, count: u32) -> CLResult<Vec<&'a T>>
|
||||
where
|
||||
Self: Sized,
|
||||
Self: Sized + 'a,
|
||||
{
|
||||
// CL spec requires validation for obj arrays, both values have to make sense
|
||||
if objs.is_null() && count > 0 || !objs.is_null() && count == 0 {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue