Repository navigation
Viewer: fix per-cycle GL texture leak on stream start/stop (RSDEV-12247) - #15275
Merged
Nir-Az merged 1 commit intoJun 24, 2026
Merged
Conversation
sysrsbuild-gh-agentic
left a comment
Collaborator
There was a problem hiding this comment.
🤖 rs-agentic bot — automated review
Good fix for a long-standing Rule-of-Three violation. The root cause analysis and the OLS-based soak test are solid. Several issues need attention before merge — see inline comments.
| #include <librealsense2/rs.hpp> | ||
|
|
||
| #include <chrono> | ||
| #include <fstream> |
Collaborator
There was a problem hiding this comment.
🤖 [rs-agentic bot] ENHANCEMENT — unused <chrono> include
#include <chrono> is included but std::chrono is not used anywhere in this translation unit (timing is delegated to test.sleep()). Remove it to keep the include list clean and avoid potential compile-time slowdown.
Contributor
Author
There was a problem hiding this comment.
Applied — removed the include. Durations are floats and timing is delegated to test.sleep(), so was indeed unused.
remibettan
force-pushed
the
viewer-start-stop-mem-leak
branch
from
June 24, 2026 10:27
0449be2 to
165699b
Compare
remibettan
force-pushed
the
viewer-start-stop-mem-leak
branch
from
June 24, 2026 10:58
165699b to
3738895
Compare
3 tasks done
remibettan
force-pushed
the
viewer-start-stop-mem-leak
branch
from
June 24, 2026 11:54
3738895 to
d743fcc
Compare
Nir-Az
approved these changes
Jun 24, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Tracked by: RSDEV-12247
Summary
texture_buffer(common/rendering.h) callsglGenTexturesinupload()but has no destructor — every stream Stop,gc_streamsdestroys+recreates the stream'stexture_buffer, leaking the GL texture handle and its driver-side allocation. Rule-of-three violation present since 2017.~texture_buffer { glDeleteTextures }(and zero the handle); delete copy/move (the prior shallow copy ctor would otherwise cause double-free).ux_window::_splash_texis a value-member destroyed afterglfwDestroyWindow— now held viaunique_ptrand reset in~ux_windowbody before the context is torn down, so itsglDeleteTexturesruns with a valid context.Numbers (D455, Release, 20× depth-only start/stop, 10s stream + 5s idle)
Test
Automated regression test (
mem_leak_depth_start_stop) lives in a separate PR: #15277.Test plan
_splash_texorder fix).