From 1503b7c7c90f06d75929fe47fc6ee478d447ae9c Mon Sep 17 00:00:00 2001 From: xue <> Date: Thu, 12 Jan 2006 20:50:34 +0000 Subject: --- framework/Web/UI/WebControls/TBaseValidator.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'framework/Web/UI/WebControls/TBaseValidator.php') diff --git a/framework/Web/UI/WebControls/TBaseValidator.php b/framework/Web/UI/WebControls/TBaseValidator.php index 1f1d0b1b..e3fc8b2f 100644 --- a/framework/Web/UI/WebControls/TBaseValidator.php +++ b/framework/Web/UI/WebControls/TBaseValidator.php @@ -92,6 +92,7 @@ abstract class TBaseValidator extends TLabel implements IValidator * @var boolean */ private $_isValid=true; + private $_registered=false; public function __construct() { @@ -103,11 +104,14 @@ abstract class TBaseValidator extends TLabel implements IValidator { parent::onInit($param); $this->getPage()->getValidators()->add($this); + $this->_registered=true; } protected function onUnload($param) { - $this->getPage()->getValidators()->remove($this); + if($this->_registered && ($page=$this->getPage())!==null) + $page->getValidators()->remove($this); + $this->_registered=false; parent::onUnload($param); } -- cgit v1.2.3