Bug 1029180: Give nsStyleContext a private destructor & MOZ_FINAL, to make it less likely to be freed by anything other than refcounting. r=heycam

This commit is contained in:
Daniel Holbert 2014-06-24 11:00:57 -07:00
parent 06770a5d3c
commit b18c859bba

View File

@ -36,7 +36,7 @@ class nsPresContext;
* collection.
*/
class nsStyleContext
class nsStyleContext MOZ_FINAL
{
public:
/**
@ -67,7 +67,6 @@ public:
nsCSSPseudoElements::Type aPseudoType,
nsRuleNode* aRuleNode,
bool aSkipParentDisplayBasedStyleFixup);
~nsStyleContext();
void* operator new(size_t sz, nsPresContext* aPresContext) CPP_THROW_NEW;
void Destroy();
@ -326,6 +325,9 @@ public:
#endif
private:
// Private destructor, to discourage deletion outside of Release():
~nsStyleContext();
void AddChild(nsStyleContext* aChild);
void RemoveChild(nsStyleContext* aChild);