Skip to content

Commit

Permalink
Cleanup snmp after resource to object migration
Browse files Browse the repository at this point in the history
  • Loading branch information
kocsismate committed Aug 4, 2020
1 parent 040b5e7 commit 2d32b63
Showing 1 changed file with 0 additions and 12 deletions.
12 changes: 0 additions & 12 deletions ext/snmp/snmp.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) \
{ \
Expand Down Expand Up @@ -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;

Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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");
Expand Down

0 comments on commit 2d32b63

Please sign in to comment.