Make WordPress Core


Ignore:
Timestamp:
11/16/2009 10:42:58 PM (17 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-includes/default-widgets.php

    r11794 r12193  
    733733                wp_widget_rss_output( $rss, $instance );
    734734                echo $after_widget;
     735                $rss->__destruct();
     736                unset($rss);
    735737        }
    736738
     
    771773                if ( is_admin() || current_user_can('manage_options') )
    772774                        echo '<p>' . sprintf( __('<strong>RSS Error</strong>: %s'), $rss->get_error_message() ) . '</p>';
    773 
     775                $rss->__destruct();
     776                unset($rss);
    774777                return;
    775778        }
     
    788791        if ( !$rss->get_item_quantity() ) {
    789792                echo '<ul><li>' . __( 'An error has occurred; the feed is probably down. Try again later.' ) . '</li></ul>';
     793                $rss->__destruct();
     794                unset($rss);
    790795                return;
    791796        }
     
    839844        }
    840845        echo '</ul>';
     846        $rss->__destruct();
     847        unset($rss);
    841848}
    842849
     
    948955                                $link = substr($link, 1);
    949956                }
     957                $rss->__destruct();
     958                unset($rss);
    950959        }
    951960
Note: See TracChangeset for help on using the changeset viewer.