Fixed a crash when loading a second session file.

This commit is contained in:
Gareth McMullin 2011-11-17 21:18:46 +13:00
parent 48ca6b54b0
commit 805e9640ff
1 changed files with 7 additions and 0 deletions

View File

@ -119,9 +119,11 @@ static int feed_chunk(int fd, int revents, void *session_data)
}
/* driver callbacks */
static void hw_cleanup(void);
static int hw_init(const char *deviceinfo)
{
hw_cleanup();
sessionfile = g_strdup(deviceinfo);
@ -135,6 +137,11 @@ static void hw_cleanup(void)
for (l = device_instances; l; l = l->next)
sr_device_instance_free(l->data);
g_slist_free(device_instances);
device_instances = NULL;
sr_session_source_remove(-1);
g_free(sessionfile);
}