mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Remove incorrect null pointer check in Object::release.
"this" should never be null here, and warns about it.
This commit is contained in:
committed by
Magne Sjaastad
parent
d1da920394
commit
f735d19c2c
@@ -81,15 +81,9 @@ inline int Object::addRef() const
|
|||||||
/// \return The new reference count.
|
/// \return The new reference count.
|
||||||
///
|
///
|
||||||
/// If the new reference count is zero, the object (this) is deleted.\n
|
/// If the new reference count is zero, the object (this) is deleted.\n
|
||||||
/// Legal to call on NULL objects, will then return zero.
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
inline int Object::release() const
|
inline int Object::release() const
|
||||||
{
|
{
|
||||||
// Release on a NULL object ok, just return 0
|
|
||||||
// This is symmetric with being able to call delete on a NULL pointer
|
|
||||||
#ifndef __clang__
|
|
||||||
if (!this) return 0;
|
|
||||||
#endif
|
|
||||||
CVF_TIGHT_ASSERT(m_refCount > 0);
|
CVF_TIGHT_ASSERT(m_refCount > 0);
|
||||||
|
|
||||||
if (--m_refCount == 0)
|
if (--m_refCount == 0)
|
||||||
|
|||||||
Reference in New Issue
Block a user