Bug 595277 - Part 0: Clear out user data on destroy. r=roc

This commit is contained in:
Bas Schouten 2010-12-07 03:05:25 +01:00
parent aee13a8cd4
commit e53c7eb164

View File

@ -190,6 +190,15 @@ public:
return mKey == aKey ? mValue.get() : nsnull;
}
/**
* Clear out current user data.
*/
void Clear()
{
mKey = nsnull;
mValue = nsnull;
}
private:
void* mKey;
nsAutoPtr<LayerUserData> mValue;
@ -241,7 +250,7 @@ public:
* for its widget going away. After this call, only user data calls
* are valid on the layer manager.
*/
virtual void Destroy() { mDestroyed = PR_TRUE; }
virtual void Destroy() { mDestroyed = PR_TRUE; mUserData.Clear(); }
PRBool IsDestroyed() { return mDestroyed; }
/**