Trim memory when disabling ExtractorSampleSource.

This prevents memory leakage even in the case where the app
is still holding a reference (direct or indirect) to the
Allocator.
This commit is contained in:
Oliver Woodman 2015-04-13 19:36:16 +01:00
parent 0d69a2eae8
commit ed1dbddc75

View File

@ -177,6 +177,7 @@ public class ExtractorSampleSource implements SampleSource, ExtractorOutput, Loa
loader.cancelLoading();
} else {
clearState();
bufferPool.trim(0);
}
}
}
@ -294,6 +295,7 @@ public class ExtractorSampleSource implements SampleSource, ExtractorOutput, Loa
restartFrom(pendingResetPositionUs);
} else {
clearState();
bufferPool.trim(0);
}
}