调用 SurfaceFlinger 的 removeGraphicBufferProducerAsync()
,通知生产者销毁了。
MonitoredProducer::~MonitoredProducer() {
// Remove ourselves from SurfaceFlinger's list. We do this asynchronously
// because we don't know where this destructor is called from. It could be
// called with the mStateLock held, leading to a dead-lock (it actually
// happens).
mFlinger->removeGraphicBufferProducerAsync(onAsBinder());
}
IBinder* MonitoredProducer::onAsBinder() {
return this;
}