Skip to content

Memory/resource error with garbage collection #14

@dkbmx

Description

@dkbmx

In a long-lived application, after creating an archive with a short-lived ArchiveWriter, an ExecutionEngineException is encountered on garbage collection.

If a reference is kept to another instance of ArchiveWriter, the exception isn't encountered, so it seems the error is only encountered when FreeLibrary is allowed on the 7z.dll when no other instances are holding the library open. If a short-lived ArchiveWriter is created but not used to create an archive, no exceptions are encountered, which leads the tracing of the issue to SevenZipLibrary.GetOutArchive and creation of the IOutArchive instance. After calling IOutArchive.UpdateItems, the IOutArchive instance should probably be released with Marshal.FinalReleaseComObject.

This should also probably be applied to other objects created by CreateObjectDelegate.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions