1
0
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:
Darien Raymond
2016-12-27 21:06:55 +01:00
parent ea33b7691b
commit 538b0720d5
5 changed files with 14 additions and 8 deletions

View File

@@ -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()
}
}