mirror of
https://chromium.googlesource.com/crosvm/crosvm
synced 2025-02-10 12:09:31 +00:00
devices: proxy: ensure device drop gets called
Explicitly drop the device object before calling libc::exit() so that the Drop impl for the device has a chance to be called. Change-Id: Id93447925f71340c78a1d80efdff5b1574801409 Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3900327 Reviewed-by: Dennis Kempin <denniskempin@google.com> Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
This commit is contained in:
parent
8e0a4cb345
commit
835a85b983
1 changed files with 4 additions and 0 deletions
|
@ -201,6 +201,10 @@ impl ProxyDevice {
|
|||
device.on_sandboxed();
|
||||
child_proc(child_tube, &mut device);
|
||||
|
||||
// Explicitly drop the device so that its Drop implementation has a chance to run
|
||||
// before the call to `libc::exit()`.
|
||||
std::mem::drop(device);
|
||||
|
||||
// We're explicitly not using std::process::exit here to avoid the cleanup of
|
||||
// stdout/stderr globals. This can cause cascading panics and SIGILL if a worker
|
||||
// thread attempts to log to stderr after at_exit handlers have been run.
|
||||
|
|
Loading…
Reference in a new issue