mirror of
https://github.com/samsonjs/media.git
synced 2026-04-27 15:07:40 +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();
|
loader.cancelLoading();
|
||||||
} else {
|
} else {
|
||||||
clearState();
|
clearState();
|
||||||
|
bufferPool.trim(0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -294,6 +295,7 @@ public class ExtractorSampleSource implements SampleSource, ExtractorOutput, Loa
|
||||||
restartFrom(pendingResetPositionUs);
|
restartFrom(pendingResetPositionUs);
|
||||||
} else {
|
} else {
|
||||||
clearState();
|
clearState();
|
||||||
|
bufferPool.trim(0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue