Skip to content
Snippets Groups Projects
Commit 57840489 authored by Raphael Grimm's avatar Raphael Grimm
Browse files

Potentially fix gui grash

parent 2515cdec
No related branches found
No related tags found
No related merge requests found
......@@ -47,12 +47,17 @@ namespace armarx::detail::RobotUnitDataStreamingReceiver
void update(const RobotUnitDataStreaming::TimeStepSeq& data, const Ice::Current&) override
{
if (_discard_data)
{
return;
}
std::lock_guard g{_data_mutex};
ARMARX_INFO << deactivateSpam()
<< "received " << data.size() << " timesteps";
_data.emplace_back(data);
}
std::atomic_bool _discard_data = false;
std::mutex _data_mutex;
std::deque<RobotUnitDataStreaming::TimeStepSeq> _data;
Ice::Identity _identity;
......@@ -86,12 +91,19 @@ namespace armarx
{
if (_proxy)
{
_receiver->_discard_data = true;
if (!_description.entries.empty())
{
_ru->stopDataStreaming(_proxy);
}
auto icemanager = _obj->getArmarXManager()->getIceManager();
auto adapter = _obj->getArmarXManager()->getAdapter();
adapter->remove(_receiver->_identity);
while (icemanager->isObjectReachable(_receiver->_identity.name))
{
ARMARX_INFO << deactivateSpam() << "waiting until receiver is removed from ice";
}
}
_proxy = nullptr;
_receiver = nullptr;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment