<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -79,6 +79,7 @@ BOOL usingMATrackingArea = NO;
 
 - (NSDictionary*) _flashVarDictionary: (NSString*) flashvarString;
 - (NSDictionary*) _flashVarDictionaryFromYouTubePageHTML: (NSString*) youTubePageHTML;
+- (void)_didRetrieveEmbeddedPlayerFlashVars:(NSDictionary *)flashVars;
 - (void)_getEmbeddedPlayerFlashVarsAndCheckForVariantsWithVideoId:(NSString *)videoId;
 - (NSString*) flashvarWithName: (NSString*) argName;
 - (void) _checkForH264VideoVariants;
@@ -1160,7 +1161,7 @@ BOOL usingMATrackingArea = NO;
 
 - (NSString*) flashvarWithName: (NSString*) argName
 {
-    return [ _flashVars objectForKey: argName ];
+    return [[[ _flashVars objectForKey: argName ] retain] autorelease];
 }
 
 /*- (NSString*) _videoId
@@ -1468,6 +1469,18 @@ didReceiveResponse:(NSHTTPURLResponse *)response
 	[openInQTPlayerScript release];
 }
 
+- (void)_didRetrieveEmbeddedPlayerFlashVars:(NSDictionary *)flashVars
+{
+	if (flashVars)
+	{
+		_flashVars = [flashVars retain];
+		NSString *videoId = [self flashvarWithName:@&quot;video_id&quot;];
+		[self setVideoId:videoId];
+	}
+	
+	[self _checkForH264VideoVariants];
+}
+
 - (void)_retrieveEmbeddedPlayerFlashVarsAndCheckForVariantsWithVideoId:(NSString *)videoId
 {
 	NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
@@ -1478,13 +1491,13 @@ didReceiveResponse:(NSHTTPURLResponse *)response
 	NSString *pageSourceString = [NSString stringWithContentsOfURL:YouTubePageURL
 													  usedEncoding:nil
 															 error:&amp;pageSourceError];
-	if (! pageSourceError) {
-		_flashVars = [[self _flashVarDictionaryFromYouTubePageHTML:pageSourceString] retain];
-		_videoId = [self flashvarWithName:@&quot;video_id&quot;];
+	NSDictionary *flashVars = nil;
+	if (pageSourceString &amp;&amp; !pageSourceError) {
+		flashVars = [self _flashVarDictionaryFromYouTubePageHTML:pageSourceString];
 	}
 	
-	[self performSelectorOnMainThread:@selector(_checkForH264VideoVariants)
-						   withObject:nil
+	[self performSelectorOnMainThread:@selector(_didRetrieveEmbeddedPlayerFlashVars:)
+						   withObject:flashVars
 						waitUntilDone:NO];
 	
 	[pool drain];
@@ -1673,7 +1686,7 @@ didReceiveResponse:(NSHTTPURLResponse *)response
 
 - (NSString *)videoId
 {
-    return _videoId;
+    return [[_videoId retain] autorelease];
 }
 - (void)setVideoId:(NSString *)newValue
 {</diff>
      <filename>Plugin/Plugin.m</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>cdc99e5ccbd6bfee432d73fad5a2b90e61116ed4</id>
    </parent>
  </parents>
  <author>
    <name>Jeff Johnson</name>
    <email>github@lapcatsoftware.com</email>
  </author>
  <url>http://github.com/rentzsch/clicktoflash/commit/ef9be0b8697a2c88f1eccc5be8502fec1511f07a</url>
  <id>ef9be0b8697a2c88f1eccc5be8502fec1511f07a</id>
  <committed-date>2009-09-09T15:08:27-07:00</committed-date>
  <authored-date>2009-09-09T15:08:27-07:00</authored-date>
  <message>Possible fix for http://rentzsch.lighthouseapp.com/projects/24342/tickets/261-crash-in-15b5-under-106</message>
  <tree>61e3ef3f93a1beed89d2a308607d2b77f8087db6</tree>
  <committer>
    <name>Jeff Johnson</name>
    <email>github@lapcatsoftware.com</email>
  </committer>
</commit>
