void OnDestroy() { if (mWebCamImpl != null) { mWebCamImpl.OnDestroy(); // destroy BackgroundCamera instance Destroy(mBackgroundCameraInstance); } }