Fixed a crash when loading a second session file.
This commit is contained in:
parent
48ca6b54b0
commit
805e9640ff
|
@ -119,9 +119,11 @@ static int feed_chunk(int fd, int revents, void *session_data)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* driver callbacks */
|
/* driver callbacks */
|
||||||
|
static void hw_cleanup(void);
|
||||||
|
|
||||||
static int hw_init(const char *deviceinfo)
|
static int hw_init(const char *deviceinfo)
|
||||||
{
|
{
|
||||||
|
hw_cleanup();
|
||||||
|
|
||||||
sessionfile = g_strdup(deviceinfo);
|
sessionfile = g_strdup(deviceinfo);
|
||||||
|
|
||||||
|
@ -135,6 +137,11 @@ static void hw_cleanup(void)
|
||||||
for (l = device_instances; l; l = l->next)
|
for (l = device_instances; l; l = l->next)
|
||||||
sr_device_instance_free(l->data);
|
sr_device_instance_free(l->data);
|
||||||
|
|
||||||
|
g_slist_free(device_instances);
|
||||||
|
device_instances = NULL;
|
||||||
|
|
||||||
|
sr_session_source_remove(-1);
|
||||||
|
|
||||||
g_free(sessionfile);
|
g_free(sessionfile);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue