mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 827596 - assert at runtime if we try to assign to a nsAutoPtr which already contains the identical pointer, r=dbaron
This commit is contained in:
parent
4ae6c6425a
commit
131ead677d
@ -34,8 +34,12 @@ class nsAutoPtr
|
||||
void
|
||||
assign( T* newPtr )
|
||||
{
|
||||
NS_ABORT_IF_FALSE(mRawPtr != newPtr || !newPtr, "This makes no sense!");
|
||||
T* oldPtr = mRawPtr;
|
||||
|
||||
if (newPtr != nullptr && newPtr == oldPtr) {
|
||||
NS_RUNTIMEABORT("Logic flaw in the caller");
|
||||
}
|
||||
|
||||
mRawPtr = newPtr;
|
||||
delete oldPtr;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user