Open theKidOfArcrania opened 3 weeks ago
Hi @theKidOfArcrania ,
It's a good question: It used be clearer in perv. versions of this struct.
Currently, IWbemClassWrapper
is a wrapper around windows::Win32::System::Wmi::IWbemClassObject
, which is defined like this:
#[repr(transparent)]
#[derive(...)]
pub struct IWbemClassObject(::windows_core::IUnknown);
And IUnknown
, as documented here, has a drop impl which calls Release
:
impl Drop for IUnknown {
fn drop(&mut self) {
unsafe {
(self.vtable().Release)(std::mem::transmute_copy(self));
}
}
}
So at least AFIK, everything should be released as expected.
The comments for
IWbemClassWrapper
mentions something about it taking care of releasing the object when dropped. Can you elaborate on this if this is true? I don't see anywhere where this suggest that this code releases any resources when this object is dropped.Specific comments: