extension_version_info->required_zend_version,
ZEND_VERSION,
ZEND_EXTENSION_API_NO);
+ DL_UNLOAD(handle);
return FAILURE;
} else if (extension_version_info->zend_extension_api_no < ZEND_EXTENSION_API_NO) {
/* we may be able to allow for downwards compatability in some harmless cases. */
ZEND_EXTENSION_API_NO,
new_extension->author,
new_extension->URL);
+ DL_UNLOAD(handle);
return FAILURE;
} else if (ZTS_V!=extension_version_info->thread_safe) {
zend_printf("Cannot load %s - it %s thread safe, whereas Zend %s\n",
new_extension->name,
(extension_version_info->thread_safe?"is":"isn't"),
(ZTS_V?"is":"isn't"));
+ DL_UNLOAD(handle);
return FAILURE;
}
if (new_extension->startup) {
- new_extension->startup(new_extension);
+ if (new_extension->startup(new_extension)!=SUCCESS) {
+ DL_UNLOAD(handle);
+ return FAILURE;
+ }
}
extension = *new_extension;
extension.handle = handle;
char *URL;
char *copyright;
- void (*startup)(zend_extension *extension);
+ int (*startup)(zend_extension *extension);
void (*shutdown)(zend_extension *extension);
void (*activate)();
void (*deactivate)();