title: iPhone App - dismissing modal view controller doesn't dealloc it
body: <p>I have a UIViewController (call it NumberTwo) which I presented as a modal view controller from another UIViewController (call it NumberOne). NumberTwo contains a touchesBegan method which listens for touches, and it also has an accelerometer method which listens for device orientation changes in the x, y, or z direction. NumberTwo has a button called "Done" which, when tapped, dismisses itself as a modal view controller:</p>
  
  <pre><code>[self dismissModalViewControllerAnimated:NO];
  </code></pre>
  
  <p>But it seems as though it's still listening for touches, and it's still listening for accelerations. How can I completely free up NumberTwo when I dismiss it? I tried adding a release call as follows:</p>
  
  <pre><code>[self dismissModalViewControllerAnimated:NO];
  [self release];
  </code></pre>
  
  <p>but that caused a EXEC_BAD_ACCESS.</p>