Developer forums (C::B DEVELOPMENT STRICTLY!) > Development
app.cpp
Michael:
C++ guarantees that operator delete checks its argument for null-ness. If the argument is 0, the delete expression has no effect. In other words, deleting a null pointer is a safe (yet useless) operation. There is no need to check the pointer for null-ness before passing it to delete.
Michael
killerbot:
Michael, I think we have a lift off :P
thomas:
Well, if you really think that this will make anything better, then you should at least do it right, there are a couple more of these constructs... :)
Like so:
[attachment deleted by admin]
Urxae:
--- Quote from: thomas on January 24, 2006, 10:54:18 pm ---Well, if you really think that this will make anything better, then you should at least do it right, there are a couple more of these constructs... :)
Like so:
[attachment: useless.patch.txt]
--- End quote ---
Actually, that looks like a nice code cleanup1, which I wouldn't call useless at all. :D
1) Especially with the annoying new wxCriticalSectionLocker removal you seem to have thrown in; what's the point of wxCriticalSectionLocker if you're going to dynamically allocate it? :shock:
thomas:
--- Quote from: Urxae on January 25, 2006, 12:03:32 am ---1) Especially with the annoying new wxCriticalSectionLocker removal you seem to have thrown in; what's the point of wxCriticalSectionLocker if you're going to dynamically allocate it? :shock:
--- End quote ---
I had already made that particular modification 2 months ago, but it somehow made its way out again...
My point with an automatic critical section locker inside a curly brace block is that it is about 200 times faster than dynamically allocating and manually freeing it, and it is exception-safe too, which is the main reason why you use a locker object in the first place. :)
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version