Commit ed1dbddc by Oliver Woodman

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.
parent 0d69a2ea
...@@ -177,6 +177,7 @@ public class ExtractorSampleSource implements SampleSource, ExtractorOutput, Loa ...@@ -177,6 +177,7 @@ public class ExtractorSampleSource implements SampleSource, ExtractorOutput, Loa
loader.cancelLoading(); loader.cancelLoading();
} else { } else {
clearState(); clearState();
bufferPool.trim(0);
} }
} }
} }
...@@ -294,6 +295,7 @@ public class ExtractorSampleSource implements SampleSource, ExtractorOutput, Loa ...@@ -294,6 +295,7 @@ public class ExtractorSampleSource implements SampleSource, ExtractorOutput, Loa
restartFrom(pendingResetPositionUs); restartFrom(pendingResetPositionUs);
} else { } else {
clearState(); clearState();
bufferPool.trim(0);
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment