mirror of
https://github.com/processing/processing4.git
synced 2026-06-16 04:26:26 +02:00
avoid memory leak
This commit is contained in:
@@ -150,8 +150,9 @@ public class StringList implements Iterable<String> {
|
||||
if (count == 0) {
|
||||
throw new RuntimeException("Can't call pop() on an empty list");
|
||||
}
|
||||
String value = get(count-1);
|
||||
count--;
|
||||
count--; // back up to the last entry
|
||||
String value = get(count);
|
||||
data[count] = null; // avoid leak
|
||||
return value;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user