Merge pull request #2406 from michaelgregorius/2023-null-pointer-deallocation

Removes an unnecessary warning in MemoryManager::free
This commit is contained in:
Colin Wallace
2015-10-11 00:31:55 +00:00

View File

@@ -105,10 +105,9 @@ void * MemoryManager::alloc( size_t size )
void MemoryManager::free( void * ptr )
{
if( ptr == NULL )
if( !ptr )
{
qDebug( "MemoryManager: Null pointer deallocation attempted" );
return; // let's not try to deallocate null pointers, ok?
return; // Null pointer deallocations are OK but do not need to be handled
}
// fetch info on the ptr and remove