Hi,
sorry, this might be a bit off topic considering the Forum's name (AVFoundation), but I don't see where else I should post.
Here's my problem: I've to play say 200 short movies one after the other. For the purpose, I use QTMovie and QTMovieView from the QTKit framework, which I instatiate and delete when I'm done, for each movie. That works just fine up to the first 55 movies, then the application crashes (and not always at the same point in the code). I don't understand the cause of the crash, but I've investigated a bit the situation and I've seen some weird things which might be related to it:
- At each new movie, 3 threads are added, but then, when the movie ends and I release the resources, only one disappear, so that the number of threads related to my application grows linearly with the number of movies played.
- The applications crashes always at the same amount of allocated threads.
- The 2 threads that are never terminated are marked QTCALayerRenderPendingQWorkLoop and QTVisualContextImageProviderWorkLoop and are started with the instruction [view setMovie: movie] is executed.
I don't see any reason why those threads keep hanging around when I've released all the resources related to a movie. Does anybody knows how I can terminate them?
Here's below is the relevant code:
// Movie creation (Open function)
window = [[NSWindow alloc] autorelease];
view = [[[QTMovieView alloc] initWithFrame: frame autorelease];
[view setControllerVisible:NO];
[view setMovie: movie];
[[window contentView] addSubview: view];
....
// Movie deletion (Close function)
movie = nil;
window = nil;
view = nil;
Many thanks in advance for you help.
Cheers