It looks like the bug is here, inside onDestroy
:
if (mLiveCard != null && mLiveCard.isPublished()) {
if (mLiveCardRender != null) {
mLiveCard.getSurfaceHolder().removeCallback(mLiveCardRender);
}
mLiveCard.unpublish();
By removing the callback before the unpublish
method is called, the system no longer knows whose surfaceDestroyed
method to call when the card is removed afterwards. You can actually remove call to removeCallback
entirely; it's unnecessary.
It looks like this is a bug in some of our samples that we missed as our APIs evolved. Thanks for catching it and we'll have them updated shortly!