func (r *Receiver) Destroy() {
	if r.create == nil {
		return
	}
	n := C.CString(r.name)
	defer C.free(unsafe.Pointer(n))
	C.receiver_destroy(n)
	r.create = nil
	r.objects = nil
}
Destroy removes references to the generated PHP class for this receiver and
frees any memory used by object instances.
package engine
import "C"
import (
	"fmt"
	"reflect"
	"unsafe"
)
type Receiver struct {
	name    string
	create  func(args []interface{}) interface{}
	objects map[*C.struct__engine_receiver]*ReceiverObject
}
func (r *Receiver) NewObject(args []interface{}) (*ReceiverObject, error) {
	obj := &ReceiverObject{
		instance: r.create(args),
		values:   make(map[string]reflect.Value),
		methods:  make(map[string]reflect.Value),
	}
	if obj.instance == nil {
		return nil, fmt.Errorf("Failed to instantiate method receiver")
	}
	v := reflect.ValueOf(obj.instance)
	vi := reflect.Indirect(v)
	for i := 0; i < v.NumMethod(); i++ {
		if v.Type().Method(i).PkgPath != "" {
			continue
		}
		obj.methods[v.Type().Method(i).Name] = v.Method(i)
	}
	if vi.Kind() == reflect.Struct {
		for i := 0; i < vi.NumField(); i++ {
			if vi.Type().Field(i).PkgPath != "" {
				continue
			}
			obj.values[vi.Type().Field(i).Name] = vi.Field(i)
		}
	}
	return obj, nil
}