Fix frame image race condition + refactor

- In the connection state, retrieve the FrameImage while owning the data lock.
- Use actual image data pointer as caching key instead of the address of ImageCache which may change during executation (unstable).
- Fixes scale Messages image tooltip scale.
- Free the connection image
This commit is contained in:
Clément Grégoire
2025-12-18 15:44:58 +01:00
parent 8b2019830a
commit 0eb9f4acb6
6 changed files with 40 additions and 68 deletions

View File

@@ -153,22 +153,8 @@ void View::DrawTimelineFrames( const FrameData& frames )
auto fi = m_worker.GetFrameImage( frames, i );
if( fi )
{
const auto scale = GetScale();
if( fi != m_frameTexturePtr )
{
if( !m_frameTexture ) m_frameTexture = MakeTexture();
UpdateTexture( m_frameTexture, m_worker.UnpackFrameImage( *fi ), fi->w, fi->h );
m_frameTexturePtr = fi;
}
ImGui::Separator();
if( fi->flip )
{
ImGui::Image( m_frameTexture, ImVec2( fi->w * scale, fi->h * scale ), ImVec2( 0, 1 ), ImVec2( 1, 0 ) );
}
else
{
ImGui::Image( m_frameTexture, ImVec2( fi->w * scale, fi->h * scale ) );
}
DrawFrameImage( m_FrameTextureCache, *fi );
if( ImGui::GetIO().KeyCtrl && IsMouseClicked( 0 ) )
{