title: AvAudioPlayer setting delegate to nil releases the delegate object?
body: <pre><code>@implementation MyClass
  
  -(id) init
  {
      NSString *path0 = [ [NSBundle mainBundle] pathForResource:@"myfile" ofType:@"m4a" ];
      mSound = [[AVAudioPlayer alloc]initWithContentsOfURL:[NSURL fileURLWithPath:path0] error:NULL]; 
      mSound.delegate = self;  
  }
  
  -(void) release 
  {
  
      mSound.delegate = nil;  //&lt;- this line causes MyClass release function to be called recursively
     [ mSound release ];      //&lt;- removing the line above makes this line do the same, i.e. calls myclass release recursively  
  }
  </code></pre>
  
  <p>It seems that releasing AvAudioPlayer releases the delegate object as well, I tried to call retain on self manually when assigning it to the delegate but it didn't help. </p>
  
  <p>even if I do something like:</p>
  
  <pre><code>-(id) init
  {
      NSString *path0 = [ [NSBundle mainBundle] pathForResource:@"myfile" ofType:@"m4a" ];
      mSound = [[AVAudioPlayer alloc]initWithContentsOfURL:[NSURL fileURLWithPath:path0] error:NULL]; 
      mSound.delegate = self; 
      mSound.delegate = nil;  //&lt;- (just for test), causes MyClass release to be invoked,    
  }
  </code></pre>
  
  <p>I get release of Myclass to be called right away from the init when I assign the delegate to nil </p>
  
  <p>Any idea whats going on?   </p>