Skip to content

Commit

Permalink
Reference : Remove child edits from m_plugEdits
Browse files Browse the repository at this point in the history
Previously, we were only removing edit entries for the immediate
children of a Reference. This could leave stale edits in the edit
cache for plugs at the grandchild level and deeper. Usually that does
not cause a problem because `m_plugEdits` is keyed using the plug
pointer address. But on Windows in particular, the address of a
destroyed plug was occasionally (something like 1 in 1000) being reused
for a new plug, causing a false positive lookup in `m_plugEdits`.
  • Loading branch information
ericmehl committed Oct 24, 2023
1 parent f419cff commit 445a9d1
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions Changes.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ Fixes
- Windows :
- Fixed a bug preventing anything except strings from being copied and pasted.
- Fixed likely cause of crash when resizing Spreadsheet column width (#5296).
- Reference : Fixed rare reloading error.

1.3.5.0 (relative to 1.3.4.0)
=======
Expand Down
5 changes: 5 additions & 0 deletions src/Gaffer/Reference.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -395,6 +395,11 @@ class Reference::PlugEdits : public Signals::Trackable
return;
}

for( Plug::RecursiveIterator it( plug ); !it.done(); ++it )
{
m_plugEdits.erase( it->get() );
}

m_plugEdits.erase( plug );
}

Expand Down

0 comments on commit 445a9d1

Please sign in to comment.