title: super dealloc EXC_BAD_ACCESS error
body: <p>While analysing our project Xcode came with a posibe leak notification at a custom UIBarButtonItem.
  I fixed the leak, but while loading the view for the second time, [super dealloc] gives a EXC_BAD_ACCESS error.</p>
  
  <p>Removing the autorelease from the UIBarButtonItem (so returning the warning):</p>
  
  <pre><code>self.navigationItem.rightBarButtonItem = [[[UIBarButtonItem alloc] initWithCustomView:toolbar] autorelease];
  </code></pre>
  
  <p>gives no problems while reloading the screen.</p>
  
  <p>Custom UIBarButtonItem and dealloc code:</p>
  
  <pre><code>- (void)viewDidLoad
  {
      [super viewDidLoad];
  
      // create a toolbar to have the buttons at the right side of the navigationBar
      UIToolbar* toolbar = [[UIToolbar alloc] initWithFrame:CGRectMake(0, 0, 150, 44.01)];
      toolbar.tintColor = [UIColor clearColor];
      [toolbar setTranslucent:YES];
  
      // create the array to hold the buttons, which then gets added to the toolbar
      NSMutableArray* buttons = [[NSMutableArray alloc] initWithCapacity:4];
  
  
      // Create a comments button
      propertiesButton = [[UIBarButtonItem alloc]
                          initWithBarButtonSystemItem:UIBarButtonSystemItemSearch target:self action:@selector(properties)];
      [buttons addObject:propertiesButton];
      [propertiesButton release];
  
      // Create a comments button
      commentaryButton = [[UIBarButtonItem alloc]
                          initWithBarButtonSystemItem:UIBarButtonSystemItemCompose target:self action:@selector(comments)];
      [buttons addObject:commentaryButton];
      [commentaryButton release];
  
      // create a versions button
      versionsButton = [[UIBarButtonItem alloc]
                        initWithBarButtonSystemItem:UIBarButtonSystemItemBookmarks target:self action:@selector(versions)];
      [buttons addObject:versionsButton];
      [versionsButton release];
  
      // create a save button
      downloadButton = [[UIBarButtonItem alloc]
                        initWithBarButtonSystemItem:UIBarButtonSystemItemOrganize target:nil action:@selector(download)];
      [buttons addObject:downloadButton];
      [downloadButton release];
  
      // stick the buttons in the toolbar
      [toolbar setItems:buttons animated:NO];
  
      [buttons release];
  
      // and put the toolbar in the nav bar
      self.navigationItem.rightBarButtonItem = [[[UIBarButtonItem alloc] initWithCustomView:toolbar] autorelease];
      [toolbar release];
  }
  
  - (void)dealloc
  {
      [popOverController release];
      [propertiesButton release];
      [downloadButton release];
      [versionsButton release];
      [commentaryButton release];
      [webView release];
      [super dealloc];
  }
  </code></pre>
  
  <p>With NSZombieEnabled i get </p>
  
  <pre><code>'2011-08-01 10:30:36.571 ProjectName[100:707] *** -[UIBarButtonItem release]: message sent to deallocated instance 0x1fb330'
  </code></pre>
  
  <p>We are not sure how to fix the problem.</p>
  
  <p>Thank you in advance.</p>