开发者

QTKit creating threads that never die when I play new movies

开发者 https://www.devze.com 2023-02-17 18:27 出处:网络
I have an app that composes movies and then plays them via QTMovieView.Each time I [movieView setMovie:newMovie], QTKit creates a开发者_如何学Go new thread that never dies.It also appears that the mov

I have an app that composes movies and then plays them via QTMovieView. Each time I [movieView setMovie:newMovie], QTKit creates a开发者_如何学Go new thread that never dies. It also appears that the movie is never dealloced. I created a simple example that illustrates the problem:

http://cl.ly/371e0p443Q2K0R3f0Q1w/MovieLeak.zip

I will happily pay someone to solve this problem!


You have a big fat memory leak in this method:

-(void)restartMovie {
    QTMovie *m = [movieView movie];
    [m stop];
    [movieView setMovie:[m copy]]; // <- copy creates an object THAT YOU OWN!!!
    [movieView play:self];
}

so this behavior is expected.

0

精彩评论

暂无评论...
验证码 换一张
取 消