Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions src/hyperlight_host/src/hypervisor/virtual_machine/whp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1360,11 +1360,6 @@ impl WhpVm {

impl Drop for WhpVm {
fn drop(&mut self) {
// Clean up any remaining file mappings that weren't explicitly unmapped.
for (handle, view) in self.file_mappings.drain(..) {
release_file_mapping(view, handle);
}

// Stop the software timer thread before tearing down the partition.
#[cfg(feature = "hw-interrupts")]
if let Some(mut t) = self.timer.take() {
Expand All @@ -1379,6 +1374,11 @@ impl Drop for WhpVm {
if let Err(e) = unsafe { WHvDeletePartition(self.partition) } {
tracing::error!("Failed to delete partition: {}", e);
}

// Clean up any remaining file mappings that weren't explicitly unmapped.
for (handle, view) in self.file_mappings.drain(..) {
release_file_mapping(view, handle);
Comment on lines +1379 to +1380
}
}
}

Expand Down
Loading