Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions src/gui/GuiRunner.cc
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ class gz::sim::GuiRunner::Implementation
public: std::thread updateThread;

/// \brief True if the initial state has been received and processed.
public: bool receivedInitialState{false};
public: std::atomic<bool> receivedInitialState{false};

/// \brief Name of WorldControl service
public: std::string controlService;
Expand Down Expand Up @@ -264,7 +264,6 @@ void GuiRunner::OnStateAsyncService(const msgs::SerializedStepMap &_res)
// variables.
QMetaObject::invokeMethod(this, "OnStateQt", Qt::QueuedConnection,
Q_ARG(msgs::SerializedStepMap, _res));
this->dataPtr->receivedInitialState = true;

// todo(anyone) store reqSrv string in a member variable and use it here
// and in RequestState()
Expand Down Expand Up @@ -302,6 +301,8 @@ void GuiRunner::OnStateQt(const msgs::SerializedStepMap &_msg)
// Update all plugins
this->dataPtr->updateInfo = convert<UpdateInfo>(_msg.stats());
this->UpdatePlugins();

this->dataPtr->receivedInitialState = true;
}

/////////////////////////////////////////////////
Expand Down