Skip to content

Commit

Permalink
(Hopefully) Fix a crash occuring after unloading and loading a Rive file
Browse files Browse the repository at this point in the history
Ownership of artboards are not moved to RiveQtQuickItem. Reset the artboard
after unloading a file.
  • Loading branch information
BertholdKrevert authored and jebos committed Nov 1, 2023
1 parent 55b64b5 commit 3a821e5
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/RiveQtQuickItem/riveqtquickitem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -485,6 +485,10 @@ void RiveQtQuickItem::loadRiveFile(const QString &source)
return;
}

if (m_currentArtboardInstance) {
m_currentArtboardInstance.reset();
}

QByteArray fileData = file.readAll();
file.close();

Expand Down

0 comments on commit 3a821e5

Please sign in to comment.