MvcDefSubject::~MvcDefSubject

MvcDefSubject::~MvcDefSubject(void)

Destroys this subject

Defined in: MvcDefSbjObs.cpp

Comments

Before we destroy this subject, we must be sure no object is still observing it. Otherwise, the observer will be left with a dangling reference. If the observer collection has any members, then the observer of this subject hasn't unobserved properly.

Notice, this assumes the observe has some way of knowing when the subject is being destroyed so that it can unobserve it first. If this isn't true for your case, you'll have to handle it specially, so we can avoid extra code size and performance hit in the base classes.