mirror of
https://github.com/samsonjs/media.git
synced 2026-03-26 09:35:47 +00:00
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:
parent
0d69a2eae8
commit
ed1dbddc75
1 changed files with 2 additions and 0 deletions
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue