8000 UPD: better thread-safe TFileSource reference counting by xBZZZZ · Pull Request #2255 · doublecmd/doublecmd · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

UPD: better thread-safe TFileSource reference counting #2255

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

xBZZZZ
Copy link
Contributor
@xBZZZZ xBZZZZ commented Apr 5, 2025
  1. works with latest freepascal ( https://gitlab.com/freepascal.org/fpc/source/-/commit/c3f80014b41db2cb4a6fa50a50c2548a03000124#note_2431141761 )
  2. impossible to find IFileSource during constructing or destructing

note: there is code like: find {subclass of IFileSource} or create it if not found

Result := FileSourceManager.Find(TWcxArchiveFileSource, ArchiveFileName) as IArchiveFileSource;
if not Assigned(Result) then
begin
if ArchiveSign then
Result := TWcxArchiveFileSource.CreateByArchiveSign(SourceFileSource, ArchiveFileName)
else if (ArchiveType = EmptyStr) then
Result := TWcxArchiveFileSource.CreateByArchiveName(SourceFileSource, ArchiveFileName)
else
Result := TWcxArchiveFileSource.CreateByArchiveType(SourceFileSource, ArchiveFileName, ArchiveType, IncludeHidden);
end;

that is not thread safe, multiple of {subclass of IFileSource} can be created if code like that runs on multiple threads

todo: test plugins (only tested zip.wcx (seems like works))

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant
0