pub struct PropertyBlob<'a> { /* private fields */ }Expand description
A kernel property blob, freed when it is dropped.
MODE_ID takes a blob id rather than a value, so a scene that sets a mode
has to create one and keep it alive for as long as the mode is set. Letting
it leak would be invisible until a long-running compositor that re-modesets
often ran the kernel out of blob ids.
The borrow of the device is what makes freeing it safe. Holding a raw descriptor instead would compile, and would destroy a blob on whatever the kernel had since recycled that number into if the blob ever outlived the device it came from.
Implementations§
Source§impl PropertyBlob<'_>
impl PropertyBlob<'_>
Sourcepub fn forget(self)
pub fn forget(self)
Give up the blob without asking the kernel to destroy it.
For when the descriptor the blob was created on is gone – a libseat session pause revokes it, and the kernel reclaimed every blob on it at that moment. Destroying through the replacement descriptor would at best fail and at worst free a different blob that happens to have been given the same id there.
This leaks nothing: the blob is already gone. Do not reach for it to silence an ordinary drop – on a live descriptor that really is a leak, and a long-running compositor that re-modesets will run the kernel out of blob ids.