From cb6b3bd9061cdfced98caaac761a614f1229fabb Mon Sep 17 00:00:00 2001 From: Michael Gregorius Date: Sat, 10 Oct 2015 22:08:31 +0200 Subject: [PATCH] Removes an unnecessary warning in MemoryManager::free Removes the warning "MemoryManager: Null pointer deallocation attempted" from MemoryManager. The warning does not make sense because deallocations of null pointers are ok in C++. Fixes #2023. --- src/core/MemoryManager.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/core/MemoryManager.cpp b/src/core/MemoryManager.cpp index 7366aa234..2f8cb675e 100644 --- a/src/core/MemoryManager.cpp +++ b/src/core/MemoryManager.cpp @@ -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