File tree Expand file tree Collapse file tree 2 files changed +15
-0
lines changed Expand file tree Collapse file tree 2 files changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -208,6 +208,14 @@ - (void)dispose {
208208}
209209
210210- (void )dealloc {
211+ if (self.irisRtcRendering ) {
212+ // the delegateId is garenteed to be auto incremented, so we can just remove
213+ // the delegate by the id, no need to check if the delegate is still valid
214+ // or is belong to this TextureRender
215+ self.irisRtcRendering ->RemoveVideoFrameObserverDelegate (self.delegateId );
216+ self.irisRtcRendering = nil ;
217+ }
218+
211219 dispatch_sync (self.pixelBufferSynchronizationQueue , ^{
212220 if (self.latestPixelBuffer ) {
213221 CVPixelBufferRelease (self.latestPixelBuffer );
Original file line number Diff line number Diff line change @@ -246,4 +246,11 @@ - (void)dispose {
246246 [self .textureRenders removeAllObjects ];
247247}
248248
249+ // - (void)dealloc {
250+ // // do not do this, coz TextureRender::TextureRender will call
251+ // // [textureRegistry unregisterTexture] which may already been dealloced by
252+ // // flutter and will bring crash
253+ // // [self dispose];
254+ // }
255+
249256@end
You can’t perform that action at this time.
0 commit comments