Fixing parameters reloaded when testing camera. Also fixed app freezing when closing Preferences dialog after using test camera dialog

This commit is contained in:
matlabbe
2026-07-03 01:28:18 -07:00
parent 405be6675a
commit 0b18ede2fb
5 changed files with 69 additions and 11 deletions
+8 -2
View File
@@ -530,15 +530,21 @@ void SensorCaptureThread::mainLoop()
info.odomPose.setNull();
}
if(!data.imageCompressed().empty() || !data.imageRaw().empty() || !data.laserScanRaw().empty() || (dynamic_cast<DBReader*>(_camera) != 0 && data.id()>0)) // intermediate nodes could not have image set
if(this->isKilled())
{
// A kill was requested (e.g. while we were blocked capturing this frame): don't
// publish anything so we never deliver events to handlers that are being torn down.
}
else if(!data.imageCompressed().empty() || !data.imageRaw().empty() || !data.laserScanRaw().empty() || (dynamic_cast<DBReader*>(_camera) != 0 && data.id()>0)) // intermediate nodes could not have image set
{
postUpdate(&data, &info);
info.cameraName = _lidar?_lidar->getSerial():_camera->getSerial();
info.timeTotal = totalTime.ticks();
this->post(new SensorEvent(data, info));
}
else if(!this->isKilled())
else
{
// Not killed but no data: end of stream. Signal consumers once, then stop.
UWARN("no more data...");
this->kill();
this->post(new SensorEvent());