Skip to content

Commit

Permalink
Make "deinit" if TestObject visible to track memory leaks
Browse files Browse the repository at this point in the history
  • Loading branch information
pd95 committed Oct 4, 2021
1 parent 9fc8b3b commit 7f10126
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions Views/StateObjectDemo.swift
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,10 @@ class TestObject: ObservableObject, CustomStringConvertible {
print("🟢 TestObject init")
}

deinit {
print("🔴 TestObject deinit")
}

var description: String {
"TestObject(num: \(num))"
}
Expand Down

0 comments on commit 7f10126

Please sign in to comment.