Fix a bug in the resource dispencer

This commit is contained in:
Zeev Suraski 2000-04-28 15:52:02 +00:00
parent b7f2d80a28
commit ddbcbb666d
3 changed files with 11 additions and 2 deletions

View File

@ -327,7 +327,7 @@ int zend_startup(zend_utility_functions *utility_functions, char **extensions, i
zend_v_compile_files = v_compile_files;
zend_execute = execute;
zend_llist_init(&zend_extensions, sizeof(zend_extension), (void (*)(void *)) zend_extension_dtor, 1);
zend_startup_extensions();
/* set up version */
zend_version_info = strdup(ZEND_CORE_VERSION_INFO);

View File

@ -21,7 +21,7 @@
#include "zend_extensions.h"
ZEND_API zend_llist zend_extensions;
static int last_resource_number=0;
static int last_resource_number;
int zend_load_extensions(char **extension_paths)
{
@ -143,6 +143,14 @@ static void zend_extension_shutdown(zend_extension *extension)
}
int zend_startup_extensions()
{
zend_llist_init(&zend_extensions, sizeof(zend_extension), (void (*)(void *)) zend_extension_dtor, 1);
last_resource_number = 0;
return SUCCESS;
}
void zend_shutdown_extensions()
{
zend_llist_apply(&zend_extensions, (void (*)(void *)) zend_extension_shutdown);

View File

@ -92,6 +92,7 @@ ZEND_API int zend_load_extension(char *path);
ZEND_API int zend_load_extensions(char **extension_paths);
ZEND_API int zend_register_extension(zend_extension *new_extension, DL_HANDLE handle);
void zend_append_version_info(zend_extension *extension);
int zend_startup_extensions(void);
void zend_shutdown_extensions(void);
#endif /* _ZEND_EXTENSIONS_H */