0

According to the docs,

error handling in Swift does not involve unwinding the call stack, a process that can be computationally expensive.

Then how deallocation of objects happen? Example:- class A is having 'a' method, Class B is having 'b' method and Class C is having 'c' method.

a called b and b called c. When Exception occurred in c how deallocation of A,B,C objects happen?

  • Possible duplicate of [Error handling in Swift does not involve stack unwinding. What does it mean?](https://stackoverflow.com/questions/46814233/error-handling-in-swift-does-not-involve-stack-unwinding-what-does-it-mean) – Dalija Prasnikar Mar 29 '18 at 08:21
  • In the above link "the GNU C++ unwinder does not call object destructors when an unhandled exception occurs. The reason for this is to improve debuggability." is mentioned. If an exception occurs then how deallocation of objects occur? – rajneesh biswal Mar 29 '18 at 08:51

0 Answers0