Description[Device Sensors] Fix crash on shutdown
DataFetcherSharedMemoryBase has a thread to which it posts tasks. It
currently stops this thread in its destructor. However, this behavior
is problematic: the tasks call pure virtual methods of
DataFetcherSharedMemoryBase, and stopping the thread ensures that all
pending tasks are run. The combination of these facts mean that code
gets run in the DataFetcherSharedMemoryBase that calls pure virtual
methods of that class, which naturally causes crashes (as the
subclass' vtable has been torn down at that point).
This CL fixes the problem by stopping the thread in
DataFetcherSharedMemoryBase::Shutdown(), at which point the subclass
instance is guaranteed to still be alive.
BUG=699496
Review-Url: https://codereview.chromium.org/2743493003
Cr-Commit-Position: refs/heads/master@{#455797}
Committed: https://chromium.googlesource.com/chromium/src/+/55462c0bffc90caf9c5e11bdd6a5d611f187330d
Patch Set 1 #Patch Set 2 : nits #Patch Set 3 : Fix unittest #
Messages
Total messages: 16 (12 generated)
|