Code::Blocks Forums
Developer forums (C::B DEVELOPMENT STRICTLY!) => Development => Topic started by: tiwag on April 12, 2006, 05:39:27 pm
-
thanks for removing all sanitychecks,
now the crash on exit is back 8)
when running under linux ...
-
You're welcome :)
Besides, I just found that it crashes under Windows, too, if you have a source file open, but no project. :)
-
Besides, I just found that it crashes under Windows, too, if you have a source file open, but no project. :)
And this one is fixed.
-
: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.
-
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 :)
-
OK then! I'll trust you guys in this.
P.S. How long till all bugs get fixed? I'm anxious to test RC3 :wink:
Oh, yeah, I forgot. The reason for the sanity checks was the infamous wxApp::Yield(). IIRC, there was a part of the code that needed a rewriting to get rid of this and still be responsive. Was it the compiler? :| I can't remember...