<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" /><style type="text/css"><!--
#msg dl { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fc0 solid; padding: 6px; }
#msg ul, pre { overflow: auto; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<title>[12193] trunk:
  Force destruction of SimplePie objects for versions of PHP that don'
 t release memory properly.</title>
</head>
<body>

<div id="msg">
<dl>
<dt>Revision</dt> <dd><a href="http://trac.wordpress.org/changeset/12193">12193</a></dd>
<dt>Author</dt> <dd>ryan</dd>
<dt>Date</dt> <dd>2009-11-16 22:42:58 +0000 (Mon, 16 Nov 2009)</dd>
</dl>

<h3>Log Message</h3>
<pre>Force destruction of SimplePie objects for versions of PHP that don't release memory properly. Props arena, scribu. fixes <a href="http://trac.wordpress.org/ticket/11074">#11074</a></pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkwpadminincludesdashboardphp">trunk/wp-admin/includes/dashboard.php</a></li>
<li><a href="#trunkwpincludesdefaultwidgetsphp">trunk/wp-includes/default-widgets.php</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkwpadminincludesdashboardphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/includes/dashboard.php (12192 => 12193)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/includes/dashboard.php        2009-11-16 18:53:57 UTC (rev 12192)
+++ trunk/wp-admin/includes/dashboard.php        2009-11-16 22:42:58 UTC (rev 12193)
</span><span class="lines">@@ -624,11 +624,15 @@
</span><span class="cx">                         printf(__('&lt;strong&gt;RSS Error&lt;/strong&gt;: %s'), $rss-&gt;get_error_message());
</span><span class="cx">                         echo '&lt;/p&gt;';
</span><span class="cx">                 }
</span><ins>+                $rss-&gt;__destruct(); 
+                unset($rss);
</ins><span class="cx">                 return;
</span><span class="cx">         }
</span><span class="cx"> 
</span><span class="cx">         if ( !$rss-&gt;get_item_quantity() ) {
</span><span class="cx">                 echo '&lt;p&gt;' . __('This dashboard widget queries &lt;a href=&quot;http://blogsearch.google.com/&quot;&gt;Google Blog Search&lt;/a&gt; so that when another blog links to your site it will show up here. It has found no incoming links&amp;hellip; yet. It&amp;#8217;s okay &amp;#8212; there is no rush.') . &quot;&lt;/p&gt;\n&quot;;
</span><ins>+                $rss-&gt;__destruct(); 
+                unset($rss);
</ins><span class="cx">                 return;
</span><span class="cx">         }
</span><span class="cx"> 
</span><span class="lines">@@ -682,7 +686,8 @@
</span><span class="cx">         }
</span><span class="cx"> 
</span><span class="cx">         echo &quot;&lt;/ul&gt;\n&quot;;
</span><del>-
</del><ins>+        $rss-&gt;__destruct(); 
+        unset($rss);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> function wp_dashboard_incoming_links_control() {
</span><span class="lines">@@ -737,12 +742,18 @@
</span><span class="cx">                         printf(__('&lt;strong&gt;RSS Error&lt;/strong&gt;: %s'), $rss-&gt;get_error_message());
</span><span class="cx">                         echo '&lt;/p&gt;&lt;/div&gt;';
</span><span class="cx">                 }
</span><ins>+                $rss-&gt;__destruct(); 
+                unset($rss);
</ins><span class="cx">         } elseif ( !$rss-&gt;get_item_quantity() ) {
</span><ins>+                $rss-&gt;__destruct(); 
+                unset($rss);
</ins><span class="cx">                 return false;
</span><span class="cx">         } else {
</span><span class="cx">                 echo '&lt;div class=&quot;rss-widget&quot;&gt;';
</span><span class="cx">                 wp_widget_rss_output( $rss, $widgets['dashboard_secondary'] );
</span><span class="cx">                 echo '&lt;/div&gt;';
</span><ins>+                $rss-&gt;__destruct(); 
+                unset($rss);
</ins><span class="cx">         }
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -825,6 +836,9 @@
</span><span class="cx">                 echo &quot;&lt;h4&gt;$label&lt;/h4&gt;\n&quot;;
</span><span class="cx">                 echo &quot;&lt;h5&gt;&lt;a href='$link'&gt;$title&lt;/a&gt;&lt;/h5&gt;&amp;nbsp;&lt;span&gt;(&lt;a href='$ilink' class='thickbox' title='$title'&gt;&quot; . __( 'Install' ) . &quot;&lt;/a&gt;)&lt;/span&gt;\n&quot;;
</span><span class="cx">                 echo &quot;&lt;p&gt;$description&lt;/p&gt;\n&quot;;
</span><ins>+                
+                $$feed-&gt;__destruct();
+                unset($$feed);
</ins><span class="cx">         }
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -922,6 +936,8 @@
</span><span class="cx">                                 $widget_options[$widget_id]['title'] = htmlentities(strip_tags($rss-&gt;get_title()));
</span><span class="cx">                         else
</span><span class="cx">                                 $widget_options[$widget_id]['title'] = htmlentities(__('Unknown Feed'));
</span><ins>+                        $rss-&gt;__destruct(); 
+                        unset($rss);
</ins><span class="cx">                 }
</span><span class="cx">                 update_option( 'dashboard_widget_options', $widget_options );
</span><span class="cx">         }
</span></span></pre></div>
<a id="trunkwpincludesdefaultwidgetsphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-includes/default-widgets.php (12192 => 12193)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-includes/default-widgets.php        2009-11-16 18:53:57 UTC (rev 12192)
+++ trunk/wp-includes/default-widgets.php        2009-11-16 22:42:58 UTC (rev 12193)
</span><span class="lines">@@ -732,6 +732,8 @@
</span><span class="cx">                         echo $before_title . $title . $after_title;
</span><span class="cx">                 wp_widget_rss_output( $rss, $instance );
</span><span class="cx">                 echo $after_widget;
</span><ins>+                $rss-&gt;__destruct(); 
+                unset($rss);
</ins><span class="cx">         }
</span><span class="cx"> 
</span><span class="cx">         function update($new_instance, $old_instance) {
</span><span class="lines">@@ -770,7 +772,8 @@
</span><span class="cx">         if ( is_wp_error($rss) ) {
</span><span class="cx">                 if ( is_admin() || current_user_can('manage_options') )
</span><span class="cx">                         echo '&lt;p&gt;' . sprintf( __('&lt;strong&gt;RSS Error&lt;/strong&gt;: %s'), $rss-&gt;get_error_message() ) . '&lt;/p&gt;';
</span><del>-
</del><ins>+                $rss-&gt;__destruct(); 
+                unset($rss);
</ins><span class="cx">                 return;
</span><span class="cx">         }
</span><span class="cx"> 
</span><span class="lines">@@ -787,6 +790,8 @@
</span><span class="cx"> 
</span><span class="cx">         if ( !$rss-&gt;get_item_quantity() ) {
</span><span class="cx">                 echo '&lt;ul&gt;&lt;li&gt;' . __( 'An error has occurred; the feed is probably down. Try again later.' ) . '&lt;/li&gt;&lt;/ul&gt;';
</span><ins>+                $rss-&gt;__destruct(); 
+                unset($rss);
</ins><span class="cx">                 return;
</span><span class="cx">         }
</span><span class="cx"> 
</span><span class="lines">@@ -838,6 +843,8 @@
</span><span class="cx">                 }
</span><span class="cx">         }
</span><span class="cx">         echo '&lt;/ul&gt;';
</span><ins>+        $rss-&gt;__destruct(); 
+        unset($rss);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> 
</span><span class="lines">@@ -947,6 +954,8 @@
</span><span class="cx">                         while ( stristr($link, 'http') != $link )
</span><span class="cx">                                 $link = substr($link, 1);
</span><span class="cx">                 }
</span><ins>+                $rss-&gt;__destruct(); 
+                unset($rss);
</ins><span class="cx">         }
</span><span class="cx"> 
</span><span class="cx">         return compact( 'title', 'url', 'link', 'items', 'error', 'show_summary', 'show_author', 'show_date' );
</span></span></pre>
</div>
</div>

</body>
</html>