Move release of serial adapter to before underlying device is released

This commit is contained in:
Paul Dino Jones 2025-03-26 18:25:26 -04:00
parent 14fb81ee43
commit 4e6bf4684a
1 changed files with 8 additions and 7 deletions

View File

@ -361,6 +361,13 @@ void shmdatamapcallback(uv_timer_t* handle)
}
}
sleep(1);
for(int d = 0; d < 10; d++)
{
if(monocoque_serial_devices[d].portname != NULL)
{
free(monocoque_serial_devices[d].portname);
}
}
for (int x = 0; x < numdevices; x++)
{
if (devices[x].initialized == true)
@ -370,13 +377,7 @@ void shmdatamapcallback(uv_timer_t* handle)
}
free(devices);
for(int d = 0; d < 10; d++)
{
if(monocoque_serial_devices[d].portname != NULL)
{
free(monocoque_serial_devices[d].portname);
}
}
int r = simfree(simdata, simmap, f->map);
slogd("simfree returned %i", r);
f->numdevices = 0;