The callback functions are set nullptr in ComposerClient::~ComposerClient()
./composer/2.1/default/ComposerClient.cpp:160: mHal.enableCallback(false)
However, the callbacks are still used in hwc2on1adaptor, it will cause segment fault.
Bug:
64650599
Test: adb shell stop
Change-Id: I92e6a6b42418e987a7ead041f2d95c194b6a16e8
Signed-off-by: Randy Xu <randy.xu@intel.com>
Signed-off-by: Qiming Shi <qiming.shi@intel.com>
Signed-off-by: Yong Yao <yong.yao@intel.com>
Signed-off-by: Gaurav Sarode <sgaurav@google.com>
std::unique_lock<std::recursive_timed_mutex> lock(mStateMutex);
- mCallbacks[descriptor] = {callbackData, pointer};
+ if (pointer != nullptr) {
+ mCallbacks[descriptor] = {callbackData, pointer};
+ } else {
+ ALOGI("unregisterCallback(%s)", to_string(descriptor).c_str());
+ mCallbacks.erase(descriptor);
+ return Error::None;
+ }
bool hasPendingInvalidate = false;
std::vector<hwc2_display_t> displayIds;