From ce77c273cf73667d3901b15fc48ae968899c21a4 Mon Sep 17 00:00:00 2001 From: astaxie Date: Wed, 8 May 2013 13:56:48 +0800 Subject: [PATCH] add Destructor func --- controller.go | 4 ++++ router.go | 2 ++ 2 files changed, 6 insertions(+) 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