cosmoscout / cosmoscout-vr

:milky_way: A virtual universe which lets you explore, analyze and present huge planetary datasets and large simulation data in real-time.
Other
351 stars 27 forks source link

Safer Signals and Slots #238

Closed JonasGilg closed 3 years ago

JonasGilg commented 3 years ago

Added safeguards, that prevent a crash, when a slot is disconnected while the signal is emitting all its slots.

The slots that are disconnected while emitting will be stored and disconnected after all other slots have been called.

coveralls commented 3 years ago

Pull Request Test Coverage Report for Build 555009636


Changes Missing Coverage Covered Lines Changed/Added Lines %
src/cs-utils/Signal.hpp 17 19 89.47%
<!-- Total: 17 19 89.47% -->
Files with Coverage Reduction New Missed Lines %
src/cs-utils/Property.hpp 1 23.53%
<!-- Total: 1 -->
Totals Coverage Status
Change from base Build 534082387: 0.1%
Covered Lines: 527
Relevant Lines: 14374

💛 - Coveralls
JonasGilg commented 3 years ago

Recursive calls to emit now get ignored and a warning is logged. Connecting new slots while emitting is not a problem. The standard assures the iterator is not invalidated while inserting into a map.