mirror of
https://github.com/mcneel/opennurbs.git
synced 2026-04-04 11:26:23 +08:00
Sync changes from upstream repository
Co-authored-by: Andrew Le Bihan <andy@mcneel.com> Co-authored-by: chuck <chuck@mcneel.com> Co-authored-by: Dale Fugier <dale@mcneel.com> Co-authored-by: Dale Lear <dalelear@mcneel.com> Co-authored-by: David Eränen <david.eranen@mcneel.com> Co-authored-by: Greg Arden <greg@mcneel.com> Co-authored-by: John Croudy <john.croudy@mcneel.com> Co-authored-by: Lowell Walmsley <lowell@mcneel.com> Co-authored-by: Nathan Letwory <nathan@mcneel.com> Co-authored-by: piac <giulio@mcneel.com> Co-authored-by: Steve Baer <steve@mcneel.com> Co-authored-by: Tim Hemmelman <tim@mcneel.com>
This commit is contained in:
@@ -494,6 +494,11 @@ void ON_SimpleArray<T>::Append( const T& x )
|
||||
p = (T*)temp;
|
||||
}
|
||||
Reserve(newcapacity);
|
||||
if (nullptr == m_a)
|
||||
{
|
||||
ON_ERROR("allocation failure");
|
||||
return;
|
||||
}
|
||||
}
|
||||
m_a[m_count++] = *p;
|
||||
if (p != &x)
|
||||
@@ -1572,11 +1577,21 @@ void ON_ClassArray<T>::Append( const T& x )
|
||||
T temp; // ON_*Array<> templates do not require robust copy constructor.
|
||||
temp = x; // ON_*Array<> templates require a robust operator=.
|
||||
Reserve( newcapacity );
|
||||
if (nullptr == m_a)
|
||||
{
|
||||
ON_ERROR("allocation failure");
|
||||
return;
|
||||
}
|
||||
m_a[m_count++] = temp;
|
||||
return;
|
||||
}
|
||||
}
|
||||
Reserve(newcapacity);
|
||||
if (nullptr == m_a)
|
||||
{
|
||||
ON_ERROR("allocation failure");
|
||||
return;
|
||||
}
|
||||
}
|
||||
m_a[m_count++] = x;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user