PHP garbage collection fix
This commit is contained in:
parent
2ce6788924
commit
f12185395b
|
@ -16,6 +16,7 @@ function __comicpress_init() {
|
||||||
|
|
||||||
$comicpress = new ComicPress();
|
$comicpress = new ComicPress();
|
||||||
$comicpress->init();
|
$comicpress->init();
|
||||||
|
$addons = array();
|
||||||
|
|
||||||
if (is_dir($addons_dir = (dirname(__FILE__) . '/addons'))) {
|
if (is_dir($addons_dir = (dirname(__FILE__) . '/addons'))) {
|
||||||
$entries = glob($addons_dir . '/*');
|
$entries = glob($addons_dir . '/*');
|
||||||
|
@ -27,19 +28,19 @@ function __comicpress_init() {
|
||||||
require_once($entry . "/${classname}.inc");
|
require_once($entry . "/${classname}.inc");
|
||||||
$classname = "ComicPressAddon${classname}";
|
$classname = "ComicPressAddon${classname}";
|
||||||
if (class_exists($classname)) {
|
if (class_exists($classname)) {
|
||||||
$addon = new $classname();
|
$addons[] = new $classname();
|
||||||
$addon->init(&$comicpress);
|
end($addons)->init(&$comicpress);
|
||||||
if (is_admin()) {
|
if (is_admin()) {
|
||||||
add_action('admin_notices', array(&$addon, 'display_messages'));
|
|
||||||
if (is_array($_POST['cp'])) {
|
if (is_array($_POST['cp'])) {
|
||||||
if (isset($_POST['cp']['_nonce'])) {
|
if (isset($_POST['cp']['_nonce'])) {
|
||||||
if (wp_verify_nonce($_POST['cp']['_nonce'], 'comicpress')) {
|
if (wp_verify_nonce($_POST['cp']['_nonce'], 'comicpress')) {
|
||||||
if (method_exists($addon, 'handle_update')) {
|
if (method_exists(end($addons), 'handle_update')) {
|
||||||
$addon->handle_update();
|
end($addons)->handle_update();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
add_action('admin_notices', array(end($addons), 'display_messages'));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue