Closed pavlosantoniou closed 6 years ago
Hi, thank you very much for your interest! I really appreciate it. According to the C++ standard the delete
operation internally performs check if specified expression (pointer) is not null. Therefore, in this case this check is unnecessary.
Thanks for your comment! I have seen such null checks before delete being used in various codebases as an indication to the programmer that the pointer might be null in this execution path.
Since defaultAllocator is not allocated in all scenarios, a null check may be introduced in the Allocator's destructor