Skip to content

Commit

Permalink
Don't double delete loaded NoteData in PreviewNoteField
Browse files Browse the repository at this point in the history
  • Loading branch information
poco0317 committed Jan 28, 2021
1 parent cd27903 commit 169ec52
Showing 1 changed file with 1 addition and 10 deletions.
11 changes: 1 addition & 10 deletions src/Etterna/Actor/Gameplay/NoteFieldPreview.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -113,17 +113,8 @@ NoteFieldPreview::LoadFromNode(const XNode* pNode)
void
NoteFieldPreview::LoadNoteData(NoteData* pNoteData)
{
// avoid leaking NoteData all over the place
// (this should be comparing pointers, not data)
// something that passes this check was previously loaded via:
// - LoadNoteData
// and was not:
// - already what we have loaded
// - the empty dummy NoteData
if (m_pNoteData != p_dummyNoteData && m_pNoteData != pNoteData)
delete m_pNoteData;
// if the current and incoming NoteData pointers are the same, why load?
else if (m_pNoteData == pNoteData)
if (m_pNoteData == pNoteData)
return;

const auto* style = attemptToEnsureStyle(m_pPlayerState);
Expand Down

0 comments on commit 169ec52

Please sign in to comment.