mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-01-10 23:44:24 +00:00
Fixed a bug in the ValueTree move constructor that could leave listeners pointing to a moved-from object
This commit is contained in:
parent
d17595518f
commit
b86b95b980
1 changed files with 3 additions and 1 deletions
|
|
@ -639,11 +639,13 @@ ValueTree& ValueTree::operator= (const ValueTree& other)
|
|||
ValueTree::ValueTree (ValueTree&& other) noexcept
|
||||
: object (static_cast<SharedObject::Ptr&&> (other.object))
|
||||
{
|
||||
if (object != nullptr)
|
||||
object->valueTreesWithListeners.removeValue (&other);
|
||||
}
|
||||
|
||||
ValueTree::~ValueTree()
|
||||
{
|
||||
if (listeners.size() > 0 && object != nullptr)
|
||||
if (! listeners.isEmpty() && object != nullptr)
|
||||
object->valueTreesWithListeners.removeValue (this);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue