Make sure the autotests work.

This commit is contained in:
Jan Vidar Krey 2010-01-28 00:07:42 +01:00
parent c3ad006d07
commit 1599f63134
5 changed files with 24 additions and 5 deletions

View File

@ -50,6 +50,7 @@ static void inf_create_user()
static void inf_destroy_user() static void inf_destroy_user()
{ {
if (!inf_user) return; if (!inf_user) return;
hub_free(inf_user->connection);
hub_free(inf_user); hub_free(inf_user);
inf_user = 0; inf_user = 0;
} }

View File

@ -93,9 +93,12 @@ int uman_init(struct hub_info* hub)
return -1; return -1;
} }
users->timeout = hub_malloc_zero(sizeof(struct timeout_evt)); if (net_backend_get_timeout_queue())
timeout_evt_initialize(users->timeout, timer_statistics, hub); {
timeout_queue_insert(net_backend_get_timeout_queue(), users->timeout, TIMEOUT_STATS); users->timeout = hub_malloc_zero(sizeof(struct timeout_evt));
timeout_evt_initialize(users->timeout, timer_statistics, hub);
timeout_queue_insert(net_backend_get_timeout_queue(), users->timeout, TIMEOUT_STATS);
}
hub->users = users; hub->users = users;
return 0; return 0;
@ -107,8 +110,11 @@ int uman_shutdown(struct hub_info* hub)
if (!hub || !hub->users) if (!hub || !hub->users)
return -1; return -1;
timeout_queue_remove(net_backend_get_timeout_queue(), hub->users->timeout); if (net_backend_get_timeout_queue())
hub_free(hub->users->timeout); {
timeout_queue_remove(net_backend_get_timeout_queue(), hub->users->timeout);
hub_free(hub->users->timeout);
}
if (hub->users->list) if (hub->users->list)
{ {

View File

@ -99,6 +99,7 @@ void net_backend_shutdown()
net_cleanup_shutdown(g_backend->cleaner); net_cleanup_shutdown(g_backend->cleaner);
hub_free(g_backend->conns); hub_free(g_backend->conns);
hub_free(g_backend); hub_free(g_backend);
g_backend = 0;
} }
/** /**
@ -135,6 +136,9 @@ int net_backend_process()
struct timeout_queue* net_backend_get_timeout_queue() struct timeout_queue* net_backend_get_timeout_queue()
{ {
if (!g_backend)
return 0;
return &g_backend->timeout_queue; return &g_backend->timeout_queue;
} }

View File

@ -86,6 +86,7 @@ void net_backend_shutdown()
hub_free(g_backend->conns); hub_free(g_backend->conns);
hub_free(g_backend->changes); hub_free(g_backend->changes);
hub_free(g_backend); hub_free(g_backend);
g_backend = 0;
} }
/** /**
@ -124,6 +125,9 @@ int net_backend_process()
struct timeout_queue* net_backend_get_timeout_queue() struct timeout_queue* net_backend_get_timeout_queue()
{ {
if (!g_backend)
return 0;
return &g_backend->timeout_queue; return &g_backend->timeout_queue;
} }

View File

@ -88,6 +88,7 @@ void net_backend_shutdown()
net_cleanup_shutdown(g_backend->cleaner); net_cleanup_shutdown(g_backend->cleaner);
hub_free(g_backend->conns); hub_free(g_backend->conns);
hub_free(g_backend); hub_free(g_backend);
g_backend = 0;
} }
/** /**
@ -149,6 +150,9 @@ int net_backend_process()
struct timeout_queue* net_backend_get_timeout_queue() struct timeout_queue* net_backend_get_timeout_queue()
{ {
if (!g_backend)
return 0;
return &g_backend->timeout_queue; return &g_backend->timeout_queue;
} }