<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Pragmatic Forums | Posts in topic 'Released object still running?'</title>
    <link>/forums/100/topics/8369.rss</link>
    <language>en-us</language>
    <ttl>60</ttl>
    <item>
      <title>Released object still running? posted by Don Ky @ Sat, 25 Dec 2010 21:48:51 +0000</title>
      <description>&lt;p&gt;sorry guys tried to wrap the code in &lt;code&gt;&lt;/code&gt; tags but no luck.  I just pasted the code in previous response.&lt;/p&gt;</description>
      <pubDate>Sat, 25 Dec 2010 21:48:51 +0000</pubDate>
      <guid isPermaLink="false">forums.pragprog.com:100:8369:22437</guid>
      <author>Don Ky</author>
      <link>https://forums.pragprog.com/forums/100/topics/8369</link>
    </item>
    <item>
      <title>Released object still running? posted by Don Ky @ Sat, 25 Dec 2010 21:47:48 +0000</title>
      <description>&lt;h1&gt;import &lt;/h1&gt;

&lt;h1&gt;import &amp;#8220;Movie.h&amp;#8221;&lt;/h1&gt;





	&lt;p&gt;int main (int argc, const char * argv[]) {
    NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];&lt;/p&gt;


	&lt;pre&gt;&lt;code&gt;Movie *movie = [[Movie alloc] initWithTitle:@"Iron Man" 
                                  andRating:5
                                    andYear:2009];&lt;/code&gt;&lt;/pre&gt;


	&lt;pre&gt;&lt;code&gt;//movie.title = @"iron man";
//movie.rating = 5;&lt;/code&gt;&lt;/pre&gt;


	&lt;pre&gt;&lt;code&gt;//[movie play];
//NSLog(&lt;code&gt;"Our movie is %&lt;/code&gt;", movie);&lt;/code&gt;&lt;/pre&gt;


	&lt;pre&gt;&lt;code&gt;NSLog(@"The retain count is: %d", [movie retainCount]);&lt;/code&gt;&lt;/pre&gt;


	&lt;p&gt;//sending a message to a object already released.&lt;/p&gt;


	&lt;p&gt;return 0;&lt;br /&gt;}&lt;/p&gt;</description>
      <pubDate>Sat, 25 Dec 2010 21:47:48 +0000</pubDate>
      <guid isPermaLink="false">forums.pragprog.com:100:8369:22436</guid>
      <author>Don Ky</author>
      <link>https://forums.pragprog.com/forums/100/topics/8369</link>
    </item>
    <item>
      <title>Released object still running? posted by Don Ky @ Sat, 25 Dec 2010 21:47:15 +0000</title>
      <description>&lt;p&gt;Hello all I was viewing the bill dudney episode on memory management and ran into an issue during my build.  It appears that my Movie object is still playing after being released?&lt;/p&gt;


	&lt;p&gt;Here is the code:&lt;/p&gt;


&lt;code&gt;

#import &amp;lt;Foundation/Foundation.h&amp;gt;
#import "Movie.h" 

int main (int argc, const char * argv[]) {
    NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];

    Movie *movie = [[Movie alloc] initWithTitle:@"Iron Man" 
                                      andRating:5
                                        andYear:2009];

    //movie.title = @"iron man";
    //movie.rating = 5;

    //[movie play];
    //NSLog(@"Our movie is %@", movie);

    NSLog(@"The retain count is: %d", [movie retainCount]);

    [movie release];

    [movie play]; //sending a message to a object already released.

    [pool drain];
    return 0;
}
&lt;/code&gt;

	&lt;p&gt;The app continues to run with no issues as if the object still has a retain count? whereas in the video Dudney gets a error in gdb.&lt;/p&gt;


	&lt;p&gt;Thanks for any help.&lt;/p&gt;</description>
      <pubDate>Sat, 25 Dec 2010 21:47:15 +0000</pubDate>
      <guid isPermaLink="false">forums.pragprog.com:100:8369:22435</guid>
      <author>Don Ky</author>
      <link>https://forums.pragprog.com/forums/100/topics/8369</link>
    </item>
  </channel>
</rss>
