Skip to content

Commit e68a98d

Browse files
Wait for scatterplot OpenGL widget to be initialized, before fromVariantMap
1 parent 547d158 commit e68a98d

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/ScatterplotPlugin.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -784,6 +784,12 @@ void ScatterplotPlugin::updateSelection()
784784

785785
void ScatterplotPlugin::fromVariantMap(const QVariantMap& variantMap)
786786
{
787+
// Wait for widget to be initialized before trying to put stuff into it from the variant map.
788+
// If not, it may try to render stuff when it's not possible and result in undefined behaviour.
789+
while (!getScatterplotWidget().isInitialized())
790+
{
791+
QCoreApplication::processEvents(); // Keeps the UI responsive
792+
}
787793
ViewPlugin::fromVariantMap(variantMap);
788794

789795
variantMapMustContain(variantMap, "Settings");

0 commit comments

Comments
 (0)