Make WordPress Core


Ignore:
Timestamp:
11/16/2009 10:42:58 PM (15 years ago)
Author:
ryan
Message:

Force destruction of SimplePie objects for versions of PHP that don't release memory properly. Props arena, scribu. fixes #11074

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/includes/dashboard.php

    r12162 r12193  
    625625            echo '</p>';
    626626        }
     627        $rss->__destruct();
     628        unset($rss);
    627629        return;
    628630    }
     
    630632    if ( !$rss->get_item_quantity() ) {
    631633        echo '<p>' . __('This dashboard widget queries <a href="http://blogsearch.google.com/">Google Blog Search</a> so that when another blog links to your site it will show up here. It has found no incoming links&hellip; yet. It&#8217;s okay &#8212; there is no rush.') . "</p>\n";
     634        $rss->__destruct();
     635        unset($rss);
    632636        return;
    633637    }
     
    683687
    684688    echo "</ul>\n";
    685 
     689    $rss->__destruct();
     690    unset($rss);
    686691}
    687692
     
    738743            echo '</p></div>';
    739744        }
     745        $rss->__destruct();
     746        unset($rss);
    740747    } elseif ( !$rss->get_item_quantity() ) {
     748        $rss->__destruct();
     749        unset($rss);
    741750        return false;
    742751    } else {
     
    744753        wp_widget_rss_output( $rss, $widgets['dashboard_secondary'] );
    745754        echo '</div>';
     755        $rss->__destruct();
     756        unset($rss);
    746757    }
    747758}
     
    826837        echo "<h5><a href='$link'>$title</a></h5>&nbsp;<span>(<a href='$ilink' class='thickbox' title='$title'>" . __( 'Install' ) . "</a>)</span>\n";
    827838        echo "<p>$description</p>\n";
     839       
     840        $$feed->__destruct();
     841        unset($$feed);
    828842    }
    829843}
     
    923937            else
    924938                $widget_options[$widget_id]['title'] = htmlentities(__('Unknown Feed'));
     939            $rss->__destruct();
     940            unset($rss);
    925941        }
    926942        update_option( 'dashboard_widget_options', $widget_options );
Note: See TracChangeset for help on using the changeset viewer.