[Question] Memory management #67
Loading…
x
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Hi! Thank you for this library!
This isn't really an issue, but a question out of curiosity, since I just recently picked up Swift and the source code is not entirely clear to me yet.
How is memory handled in
adwaita-swift? Generally, in other languages, signals and property bindings prevent an object from being freed, leading to memory leaks unless disconnected properly.Is there some closure data manager or ref toggling?
Thanks in advance!
https://docs.swift.org/swift-book/documentation/the-swift-programming-language/automaticreferencecounting/
TL;DR Swift figures out when to free memory and how long something should live. Additionally, when a view is destroyed its state is destroyed (and freed) too. You don’t have to worry about memory management all that much, and Swift 6 literally won’t let you create a memory leak. If you see a leak in your app, it is coming from Libadwaita, which is written in C.
Thank you!