[MediaCCC] Fix lambda link handler keeping reference to extractor

This caused problems in NewPipe, because extractors are not serializable, and well, keeping references to them is a bad idea anyway.
This commit is contained in:
Stypox 2023-12-30 23:23:19 +01:00
parent 137e924035
commit aaf3231fc7
No known key found for this signature in database
GPG Key ID: 4BDF1B40A49FDD23
1 changed files with 3 additions and 1 deletions

View File

@ -95,9 +95,11 @@ public class MediaCCCConferenceExtractor extends ChannelExtractor {
@Nonnull
@Override
public List<ListLinkHandler> getTabs() throws ParsingException {
// avoid keeping a reference to MediaCCCConferenceExtractor inside the lambda
final JsonObject theConferenceData = conferenceData;
return List.of(new ReadyChannelTabListLinkHandler(getUrl(), getId(), ChannelTabs.VIDEOS,
(service, linkHandler) ->
new MediaCCCChannelTabExtractor(service, linkHandler, conferenceData)));
new MediaCCCChannelTabExtractor(service, linkHandler, theConferenceData)));
}
@Override