diff --git a/controller.go b/controller.go index 55319fde..ccf213aa 100644 --- a/controller.go +++ b/controller.go @@ -59,6 +59,10 @@ func (c *Controller) Prepare() { } func (c *Controller) Finish() { + +} + +func (c *Controller) Destructor() { if c.CruSession != nil { c.CruSession.SessionRelease() } diff --git a/router.go b/router.go index c447f7da..7a480ed4 100644 --- a/router.go +++ b/router.go @@ -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