mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2025-01-22 07:28:16 +01:00
fix another likely race condition
Use an ArrayList rather than an array, though that the size of the array changed mid-calc suggests there could be other problems later. We'll see.
This commit is contained in:
parent
8fb21002ad
commit
0e0615f5d2
1 changed files with 3 additions and 2 deletions
|
@ -251,16 +251,17 @@ abstract class InviteDelegate extends DelegateBase
|
||||||
|
|
||||||
private InviterItem[] getSelItems()
|
private InviterItem[] getSelItems()
|
||||||
{
|
{
|
||||||
InviterItem[] result = new InviterItem[m_checked.size()];
|
List<InviterItem> list = new ArrayList<>();
|
||||||
int next = 0;
|
int next = 0;
|
||||||
for ( int ii = 0; ii < m_lv.getChildCount(); ++ii ) {
|
for ( int ii = 0; ii < m_lv.getChildCount(); ++ii ) {
|
||||||
InviterItemFrame child = (InviterItemFrame)m_lv.getChildAt( ii );
|
InviterItemFrame child = (InviterItemFrame)m_lv.getChildAt( ii );
|
||||||
InviterItem item = child.getItem();
|
InviterItem item = child.getItem();
|
||||||
if ( m_checked.contains( item.getDev() ) ) {
|
if ( m_checked.contains( item.getDev() ) ) {
|
||||||
result[next++] = item;
|
list.add( item );
|
||||||
Assert.assertTrue( child.isChecked() || !BuildConfig.DEBUG );
|
Assert.assertTrue( child.isChecked() || !BuildConfig.DEBUG );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
InviterItem[] result = list.toArray( new InviterItem[list.size()] );
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue