addSubview also increased the retain count of the subview. Until you remove the subviews from m_contentView OR m_contentView is destroyed, the subviews will not be released by the superview.
I would also move your [m_bkg[i] release] up futher in the code, closer to where you init the imageviews; then you don't have to release them later, just get them removed from the superview or release the superview.
This is how you can add the subviews and release them right away:
Code:
for (int i=0;i<NB_BKG;i++)
{
m_bkg[i]=[[UIImageView alloc] initWithFrame:CGRectMake(0.0, 0.0, 480.0, 320.0)];
[m_contentView addSubview:m_bkg[i]];
[m_bkg[i] release];
[m_bkg[i] setImage:[TestViewCtrlAppDelegate thumbnailImage:[NSString stringWithFormat:@"test%02d",i]]];
}
In fact, I'm not sure you need the m_bkg array at all, if its only purpose was to release the imageviews. Maybe it has another purpose?