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
What happens if the user calls "free" and then the object goes out of scope? Do you get two frees on the same pointer?
One way around that is to set the pointer to NULL as part of the free function. However, one should then document that the class is unsafe from that point forward (which might be fine if it is documented).
The text was updated successfully, but these errors were encountered:
Good point.
Setting the pointer to NULL as part of the free function could work, although I believe the end user should not be aware of the memory management since this is a swift version and we have a fantastic garbage collector!
For this reason, the "free" function will be set to private!
What happens if the user calls "free" and then the object goes out of scope? Do you get two frees on the same pointer?
One way around that is to set the pointer to NULL as part of the free function. However, one should then document that the class is unsafe from that point forward (which might be fine if it is documented).
The text was updated successfully, but these errors were encountered: