Mercurial > MadButterfly
changeset 126:55f2c6402c81
-
author | Thinker K.F. Li <thinker@branda.to> |
---|---|
date | Tue, 16 Sep 2008 15:44:01 +0800 |
parents | 1c1f28c124c9 |
children | d2cc7400c971 |
files | src/observer.c |
diffstat | 1 files changed, 5 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/src/observer.c Tue Sep 16 15:31:49 2008 +0800 +++ b/src/observer.c Tue Sep 16 15:44:01 2008 +0800 @@ -3,6 +3,10 @@ #include "observer.h" #include "tools.h" +#ifndef ASSERT +#define ASSERT(x) +#endif + subject_t *subject_new(ob_factory_t *factory, void *obj, int obj_type) { subject_t *subject; @@ -24,6 +28,7 @@ void subject_free(ob_factory_t *factory, subject_t *subject) { observer_t *observer; + ASSERT(!(subject->flags & SUBF_FREE)); if(subject->flags & SUBF_BUSY) { /* Postpond the request until busy status been stoped. * SUBF_BUSY means in subject_notify().