You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I discovered a memory leak issue with the @Shared component. Creating @Shared within a function creates numerous objects that are never deallocated. I have attached a simple code example that reproduces the issue by repeatedly tapping on a view, which creates new instances of @Shared.
Notably, this leak began appearing after version 2.1.1 and appears to be linked to this pull request.
Below is the Xcode memory graph after tapping five times:
Checklist
I have determined whether this bug is also reproducible in a vanilla SwiftUI project.
If possible, I've reproduced the issue using the main branch of this package.
Description
I discovered a memory leak issue with the
@Shared
component. Creating@Shared
within a function creates numerous objects that are never deallocated. I have attached a simple code example that reproduces the issue by repeatedly tapping on a view, which creates new instances of@Shared
.Notably, this leak began appearing after version 2.1.1 and appears to be linked to this pull request.
Below is the Xcode memory graph after tapping five times:

Checklist
main
branch of this package.Expected behavior
No response
Actual behavior
No response
Reproducing project
Sharing version information
2.1.1 - 2.3.3
Destination operating system
iOS 18
Xcode version information
16.2
Swift Compiler version information
The text was updated successfully, but these errors were encountered: