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
