mirror of
https://github.com/v2fly/v2ray-core.git
synced 2025-12-26 12:05:35 -05:00
simplified Release()
This commit is contained in:
@@ -18,3 +18,10 @@ type Releasable interface {
|
||||
// Release releases all references to accelerate garbage collection.
|
||||
Release()
|
||||
}
|
||||
|
||||
// Release tries to release the given object.
|
||||
func Release(v interface{}) {
|
||||
if releasable, ok := v.(Releasable); ok {
|
||||
releasable.Release()
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user