WordPress.org

Make WordPress Core

Changeset 12193


Ignore:
Timestamp:
11/16/2009 10:42:58 PM (9 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

Location:
trunk
Files:
2 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 );
  • 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.