Bug 379565 - "Figure out a way to prevent people from using static ns(C)String instances". r=bsmedberg.
git-svn-id: svn://10.0.0.236/trunk@226538 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
@@ -515,6 +515,7 @@ class nsTAString_CharT
|
||||
, mLength(0)
|
||||
, mFlags(0)
|
||||
{
|
||||
NS_ASSERTION(mVTable, "mVTable is null! Is this a static string instance?!");
|
||||
Assign(tuple);
|
||||
}
|
||||
|
||||
@@ -551,7 +552,9 @@ class nsTAString_CharT
|
||||
, mData(data)
|
||||
, mLength(length)
|
||||
, mFlags(flags)
|
||||
{}
|
||||
{
|
||||
NS_ASSERTION(mVTable, "mVTable is null! Is this a static string instance?!");
|
||||
}
|
||||
|
||||
/**
|
||||
* optional ctor for use by subclasses.
|
||||
@@ -562,7 +565,9 @@ class nsTAString_CharT
|
||||
nsTAString_CharT(PRUint32 flags)
|
||||
: mVTable(obsolete_string_type::sCanonicalVTable)
|
||||
, mFlags(flags)
|
||||
{}
|
||||
{
|
||||
NS_ASSERTION(mVTable, "mVTable is null! Is this a static string instance?!");
|
||||
}
|
||||
|
||||
/**
|
||||
* get pointer to internal string buffer (may not be null terminated).
|
||||
|
||||
@@ -53,6 +53,7 @@
|
||||
|
||||
nsTAString_CharT::~nsTAString_CharT()
|
||||
{
|
||||
NS_ASSERTION(mVTable, "mVTable is null! Is this a static string instance?!");
|
||||
if (mVTable == obsolete_string_type::sCanonicalVTable)
|
||||
AsSubstring()->Finalize();
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user