Dispose pattern
wikipedia Dispose pattern
The dispose pattern is primarily used in languages whose runtime environment have automatic garbage collection (see motivation below), and thus may be styled as manual resource management in languages with automatic memory management.
NOTE: python、java等都采用的是这种pattern,一般采用这种pattern的programming language的exception handling syntax中都需要使用
finally-clause
。