+
+ /* User's quitting, we're done with this. */
+ delete wl;
+ }
+ }
+
+ virtual void OnGarbageCollect()
+ {
+ watchentries* old_watch = whos_watching_me;
+ whos_watching_me = new watchentries();
+
+ for (watchentries::const_iterator n = old_watch->begin(); n != old_watch->end(); n++)
+ whos_watching_me->insert(*n);
+
+ delete old_watch;
+ }
+
+ virtual void OnCleanup(int target_type, void* item)
+ {
+ if (target_type == TYPE_USER)
+ {
+ watchlist* wl;
+ userrec* user = (userrec*)item;
+
+ if (user->GetExt("watchlist", wl))
+ {
+ user->Shrink("watchlist");
+ delete wl;
+ }