mirror of
https://github.com/Evolution-X/hardware_interfaces
synced 2026-02-02 06:22:53 +00:00
Merge "Fix a bug that would access uninitialized data." into tm-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
7ab075cb83
@@ -995,11 +995,15 @@ Result<std::vector<uint8_t>> FakeVehicleHardware::parseHexString(const std::stri
|
||||
template <class CallbackType, class RequestType>
|
||||
FakeVehicleHardware::PendingRequestHandler<CallbackType, RequestType>::PendingRequestHandler(
|
||||
FakeVehicleHardware* hardware)
|
||||
: mHardware(hardware), mThread([this] {
|
||||
while (mRequests.waitForItems()) {
|
||||
handleRequestsOnce();
|
||||
}
|
||||
}) {}
|
||||
: mHardware(hardware) {
|
||||
// Don't initialize mThread in initialization list because mThread depends on mRequests and we
|
||||
// want mRequests to be initialized first.
|
||||
mThread = std::thread([this] {
|
||||
while (mRequests.waitForItems()) {
|
||||
handleRequestsOnce();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
template <class CallbackType, class RequestType>
|
||||
void FakeVehicleHardware::PendingRequestHandler<CallbackType, RequestType>::addRequest(
|
||||
|
||||
Reference in New Issue
Block a user