Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix resetting time destroying recording stream #6914

Merged
merged 2 commits into from
Jul 16, 2024
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion crates/top/rerun_c/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -614,7 +614,7 @@ pub extern "C" fn rr_recording_stream_disable_timeline(
#[allow(unsafe_code)]
#[no_mangle]
pub extern "C" fn rr_recording_stream_reset_time(stream: CRecordingStream) {
if let Some(stream) = RECORDING_STREAMS.lock().remove(stream) {
if let Some(stream) = RECORDING_STREAMS.lock().get(stream) {
stream.reset_time();
}
}
Expand Down
4 changes: 4 additions & 0 deletions rerun_cpp/tests/recording_stream.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -560,6 +560,10 @@ SCENARIO("RecordingStream can set time without errors", TEST_TAG) {
SECTION("Resetting time does not log errors") {
check_logged_error([&] { stream.reset_time(); });
}
SECTION("Can set time again after resetting the time") {
check_logged_error([&] { stream.reset_time(); });
check_logged_error([&] { stream.set_time_seconds("duration", 1.0f); });
}

SECTION("Disabling timeline does not log errors") {
check_logged_error([&] { stream.disable_timeline("doesn't exist"); });
Expand Down
Loading