Fix crash when more than two wakeup engine exists
authorJi-hoon Lee <dalton.lee@samsung.com>
Fri, 12 Apr 2019 09:49:17 +0000 (18:49 +0900)
committerJi-hoon Lee <dalton.lee@samsung.com>
Mon, 15 Apr 2019 06:54:56 +0000 (15:54 +0900)
commit881ca127eea0c02014d8c21f36a1bd8d47eda096
tree51ff8e46d11a0faff14ef63de9bc8bf5d0894b82
parent8509dbcb232bf22b26df085b4d89faecb1c2de17
Fix crash when more than two wakeup engine exists

For providing a closure to the callback function,
necessary data were stored in a vector and passed
pointer to the data inside the vector, but since
vectors re-arranges internal elements to a new
location when the size gets bigger than its capicity,
pointers to the internal elements get invalidated
which caused crash. For this reason, changed to use
deque instead of vector since deque is a stable
container that preserves internal elements' memory
location.

Change-Id: I2ba578e98d96171aea068b95ea27807b7a143c50
plugins/wakeup-manager/src/wakeup_engine_manager.cpp