]> granicus.if.org Git - php/commitdiff
Fixed module numbering
authorDmitry Stogov <dmitry@php.net>
Mon, 5 Mar 2012 12:47:25 +0000 (12:47 +0000)
committerDmitry Stogov <dmitry@php.net>
Mon, 5 Mar 2012 12:47:25 +0000 (12:47 +0000)
Zend/zend_API.c

index 9083e609c06d52101dbe2f6214659eccff6476c3..25ac500aeeadac01a83c53c3ee92d1d063ad33ba 100644 (file)
@@ -33,7 +33,6 @@
 #endif
 
 /* these variables are true statics/globals, and have to be mutex'ed on every access */
-static int module_count=0;
 ZEND_API HashTable module_registry;
 
 /* this function doesn't check for too many parameters */
@@ -2184,7 +2183,7 @@ int module_registry_unload_temp(const zend_module_entry *module TSRMLS_DC) /* {{
 /* return the next free module number */
 int zend_next_free_module(void) /* {{{ */
 {
-       return ++module_count;
+       return zend_hash_num_elements(&module_registry) + 1;
 }
 /* }}} */