crosvm/cros_async
Chirantan Ekbote 8e80902ce3 cros_async: Fix circular reference memory leak
PollSource keeps a strong reference to the FdExecutor, which can lead to
a memory leak via a circular reference if the caller spawns a future
that owns a PollSource and then detaches it.  Avoid this by using weak
references instead.

With this change, we now only use weak references internally.  The only
way to increase the strong reference count is by cloning the FdExecutor.

BUG=none
TEST=unit tests

Change-Id: Ic58ff475a31c6fca831c3ced73b26b87ceeda028
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/2760378
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Dylan Reid <dgreid@chromium.org>
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
2021-03-17 19:24:07 +00:00
..
src cros_async: Fix circular reference memory leak 2021-03-17 19:24:07 +00:00
.build_test_skip build_test: misc options, improvements, amd bug fixes 2020-10-15 13:40:32 +00:00
Cargo.toml Move libchromeos::sync to cros_async::sync. 2021-03-16 18:12:03 +00:00