]> granicus.if.org Git - php/commitdiff
Cleanup snmp after resource to object migration
authorMáté Kocsis <kocsismate@woohoolabs.com>
Tue, 4 Aug 2020 07:14:12 +0000 (09:14 +0200)
committerMáté Kocsis <kocsismate@woohoolabs.com>
Tue, 4 Aug 2020 07:14:12 +0000 (09:14 +0200)
ext/snmp/snmp.c

index f948dda74c8bbb080373a6ab266918610378fb4f..7cc7714d382ad3d64569749b7c86c8e72e203ce0 100644 (file)
@@ -78,7 +78,6 @@ extern netsnmp_log_handler *logh_head;
 #define SNMP_VALUE_OBJECT      (1 << 1)
 
 typedef struct snmp_session php_snmp_session;
-#define PHP_SNMP_SESSION_RES_NAME "SNMP session"
 
 #define PHP_SNMP_ADD_PROPERTIES(a, b) \
 { \
@@ -113,8 +112,6 @@ static PHP_GINIT_FUNCTION(snmp);
 /* constant - can be shared among threads */
 static oid objid_mib[] = {1, 3, 6, 1, 2, 1};
 
-static int le_snmp_session;
-
 /* Handlers */
 static zend_object_handlers php_snmp_object_handlers;
 
@@ -185,13 +182,6 @@ static void netsnmp_session_free(php_snmp_session **session) /* {{{ */
 }
 /* }}} */
 
-static void php_snmp_session_destructor(zend_resource *rsrc) /* {{{ */
-{
-       php_snmp_session *session = (php_snmp_session *)rsrc->ptr;
-       netsnmp_session_free(&session);
-}
-/* }}} */
-
 static void php_snmp_object_free_storage(zend_object *object) /* {{{ */
 {
        php_snmp_object *intern = php_snmp_fetch_object(object);
@@ -1936,8 +1926,6 @@ PHP_MINIT_FUNCTION(snmp)
        netsnmp_log_handler *logh;
        zend_class_entry ce, cex;
 
-       le_snmp_session = zend_register_list_destructors_ex(php_snmp_session_destructor, NULL, PHP_SNMP_SESSION_RES_NAME, module_number);
-
        init_snmp("snmpapp");
        /* net-snmp corrupts the CTYPE locale during initialization. */
        setlocale(LC_CTYPE, "C");