From bcab617b9dea4d26cb1073637ca157bb5bc51ddb Mon Sep 17 00:00:00 2001 From: Joshua Goins Date: Tue, 6 May 2025 19:31:41 -0400 Subject: [PATCH] Move m_sectionIncubating/m_avatarIncubating/m_readMarkerIncubating set This should be set *before* we clean up the incubator, because it could end up accessing invalid data when the incubator is freed. This fixes a regularly occuring crash when switching rooms. --- src/timeline/messagedelegate.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/timeline/messagedelegate.cpp b/src/timeline/messagedelegate.cpp index 897cad0ec..2117237f0 100644 --- a/src/timeline/messagedelegate.cpp +++ b/src/timeline/messagedelegate.cpp @@ -228,8 +228,8 @@ void MessageDelegateBase::updateAvatar() } markAsDirty(); } - cleanupIncubator(incubator); m_avatarIncubating = false; + cleanupIncubator(incubator); }, m_errorCallback); m_avatarComponent->create(*avatarIncubator, qmlContext(m_avatarComponent)); @@ -291,8 +291,8 @@ void MessageDelegateBase::updateSection() } markAsDirty(); } - cleanupIncubator(incubator); m_sectionIncubating = false; + cleanupIncubator(incubator); }, m_errorCallback); m_sectionComponent->create(*sectionIncubator, qmlContext(m_sectionComponent)); @@ -354,8 +354,8 @@ void MessageDelegateBase::updateReadMarker() } markAsDirty(); } - cleanupIncubator(incubator); m_readMarkerIncubating = false; + cleanupIncubator(incubator); }, m_errorCallback); m_readMarkerComponent->create(*readMarkerIncubator, qmlContext(m_readMarkerComponent));