Browse Source

Fixed Array::remove (ElementType*) so that if given an invalid pointer, it doesn't attempt to remove anything after the assert.

tags/2021-05-28
Timur Doumler 9 years ago
parent
commit
e8cdc65357
1 changed files with 6 additions and 1 deletions
  1. +6
    -1
      modules/juce_core/containers/juce_Array.h

+ 6
- 1
modules/juce_core/containers/juce_Array.h View File

@@ -853,7 +853,12 @@ public:
jassert (data.elements != nullptr);
const int indexToRemove = int (elementToRemove - data.elements);
jassert (isPositiveAndBelow (indexToRemove, numUsed));
if (! isPositiveAndBelow (indexToRemove, numUsed))
{
jassertfalse;
return;
}
removeInternal (indexToRemove);
}


Loading…
Cancel
Save