add Destructor func

This commit is contained in:
astaxie 2013-05-08 13:56:48 +08:00
parent d2e0960b8e
commit ce77c273cf
2 changed files with 6 additions and 0 deletions

View File

@ -59,6 +59,10 @@ func (c *Controller) Prepare() {
}
func (c *Controller) Finish() {
}
func (c *Controller) Destructor() {
if c.CruSession != nil {
c.CruSession.SessionRelease()
}

View File

@ -388,6 +388,8 @@ func (p *ControllerRegistor) ServeHTTP(rw http.ResponseWriter, r *http.Request)
}
}
}
method = vc.MethodByName("Destructor")
method.Call(in)
}
//if no matches to url, throw a not found exception