Skip to content

Commit

Permalink
null out row
Browse files Browse the repository at this point in the history
  • Loading branch information
JoshRosen committed Jul 27, 2015
1 parent f4cf91d commit 590f311
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ Iterator<InternalRow> sort() throws IOException {
return new AbstractScalaRowIterator() {

private final int numFields = schema.length();
private final UnsafeRow row = new UnsafeRow();
private UnsafeRow row = new UnsafeRow();

@Override
public boolean hasNext() {
Expand All @@ -142,7 +142,7 @@ public InternalRow next() {
sortedIterator.getRecordLength());
if (!hasNext()) {
UnsafeRow copy = row.copy(); // so that we don't have dangling pointers to freed page
row.pointTo(null, 0, 0, 0); // so that we don't keep references to the base object
row = null; // so that we don't keep references to the base object
cleanupResources();
return copy;
} else {
Expand Down

0 comments on commit 590f311

Please sign in to comment.