예제 #1
0
func (s *VirStream) Free() error {
	result := C.virStreamFree(s.ptr)
	if result < 0 {
		return errors.New(GetLastError())
	}
	return nil
}
예제 #2
0
func (v *VirStream) Free() error {
	result := C.virStreamFree(v.ptr)
	if result == -1 {
		return GetLastError()
	}

	return nil
}
예제 #3
0
// Free decrements the reference count on a stream, releasing the stream object
// if the reference count has hit zero.
// There must not be an active data transfer in progress when releasing the
// stream. If a stream needs to be disposed of prior to end of stream being
// reached, then the Abort function should be called first.
func (str Stream) Free() error {
	str.log.Println("freeing stream object...")
	cRet := C.virStreamFree(str.virStream)
	ret := int32(cRet)

	if ret == -1 {
		err := LastError()
		str.log.Printf("an error occurred: %v\n", err)
		return err
	}

	str.log.Println("stream freed")

	return nil
}