Developer forums (C::B DEVELOPMENT STRICTLY!) > Development
CB svn rev 2338 !sanitychecked
tiwag:
thanks for removing all sanitychecks,
now the crash on exit is back 8)
when running under linux ...
thomas:
You're welcome :)
Besides, I just found that it crashes under Windows, too, if you have a source file open, but no project. :)
thomas:
--- Quote from: thomas on April 12, 2006, 06:21:14 pm ---Besides, I just found that it crashes under Windows, too, if you have a source file open, but no project. :)
--- End quote ---
And this one is fixed.
rickg22:
:shock:!!!!
What? You removed all the sanity checks!? :( Oh man - Do you realize that many functions assume that the sanity checks are there? And no, I don't remember them... now I got scared.
thomas:
Sanity check does a null pointer check and keeps a copy of this as a member variable.
The purpose of the null pointer check is quite clear, but I tried to find out what a local copy of this could be good for this morning.
After experimenting for two hours (allocating, freeing, changing pointers, deriving classes, overwriting pointers), I found no real case in which having a copy of this as a member would be an advantage. It does catch overwriting a previously correctly assigned pointer (why on earth would anyone do that?), but it does not catch an uninitialised pointer or anything else.
Thus, since I was unable to figure what all this magic was good for (except a null pointer check), I asked Yiannis whether he knew. Yiannis said we actually did not need sanity checks any more, since they were remnants of old times.
I wondered whether it was generally a good idea to "hide" a programming error (such as a null pointer) rather than address the root of the problem. Yiannis agreed on that and said we should rather accept a crash, look at the backtrace, and then fix the error, instead of brushing the problem under the carpet.
He then suggested I should feel free to remove the sanity checks alltogether, and I was happy to do so.
So far, the results don't look too desasterous. Tiwag is witnessing the son of crash on close under Linux, and I have seen a crash on close under Windows if editors are open without a project (this no longer persists).
On the positive side, we now have quite noticeable reduction in code size :)
Navigation
[0] Message Index
[#] Next page
Go to full version