app crashes when releasing object
<p>I am working on an iPhone application.In that app I am switching from one view to another by</p>

<pre><code>loginpage *loginview = [[loginpage alloc]init];

[self presentModelViewController:loginview animated:YES];
</code></pre>

<p><code>[loginview release];</code>  </p>

<p>this code.It is working fine.But in the second view(loginpage) when I press back button than this code </p>

<pre><code>[self dismissModalViewControllerAnimated:Yes];
</code></pre>

<p>gets fired and after that app crashes.Can anyone please help me out.Please suggest me what should I do to resolve this.Thanks in advance</p>
