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
However, still a bit confused on deinit's behaviour
It's only called once the object is nil (no refs). Don't want to have to manually set it once done (might as well use close()). Neither do we want to use optional binding (it's a long lived object, gets repetitive). Want to use an implicitly unwrapped optional (due to the failable init()), but then deinit doesn't get called
What happens on program exit? Doesn't seem to be called. Want to still make sure that connection is closed. It's not a memory issue, OS X takes care of that on proc exit
The text was updated successfully, but these errors were encountered:
This no longer applies since SMC is now a struct, not a class. Even so, the general conclusion was that deinit() should not be relied on for such things. The Swift book seems to suggest it can nonetheless. If a new development comes along, we can look at this again. But it probably wouldn't be worth the performance trade-off anyway.
deinit
's behaviournil
(no refs). Don't want to have to manually set it once done (might as well useclose()
). Neither do we want to use optional binding (it's a long lived object, gets repetitive). Want to use an implicitly unwrapped optional (due to the failableinit()
), but thendeinit
doesn't get calledThe text was updated successfully, but these errors were encountered: