properly release memory

fix https://github.com/chrislusf/seaweedfs/issues/301
This commit is contained in:
Chris Lu
2016-05-13 00:19:57 -07:00
parent e639f1f889
commit f8b03c45ef
5 changed files with 7 additions and 7 deletions

View File

@@ -66,7 +66,9 @@ func getBytesForFileBlock(r *os.File, offset int64, readSize int) (dataSlice []b
}
func (n *Needle) ReleaseMemory() {
n.rawBlock.decreaseReference()
if n.rawBlock != nil {
n.rawBlock.decreaseReference()
}
}
func ReleaseBytes(b []byte) {
bytesPool.Put(b)