Some compile fixes and memory leak fixes for ADCRush.

This commit is contained in:
Jan Vidar Krey
2009-10-06 14:36:49 +02:00
parent 20ef6f8e53
commit de793ea9d2
2 changed files with 144 additions and 8 deletions

View File

@@ -79,13 +79,16 @@ static void timer_callback(struct net_timer* t, void* arg)
static void event_callback(struct net_connection* con, int events, void *arg)
{
struct ADC_client* client = (struct ADC_client*) arg;
struct ADC_client* client = (struct ADC_client*) con->ptr;
if (events == NET_EVENT_DESTROYED)
{
printf("NET_EVENT_DESTROYED\n");
hub_free(client->con);
client->con = 0;
if (client)
{
client->con = 0;
}
hub_free(con);
return;
}
@@ -433,7 +436,11 @@ void ADC_client_disconnect(struct ADC_client* client)
{
if (client->con && client->con->sd != -1)
{
net_con_close(client->con);
if (net_con_close(client->con))
{
hub_free(client->con);
}
client->con = 0;
}
}