Skip to content
Commit 14628395 authored by Dmitry Kazakov's avatar Dmitry Kazakov
Browse files

Added a concept of "safe" assert

If you add some sanity check to the code and you are 100% sure
that failing this assert and recovering after it will not break
Krita and the user will be able to continue his work, you can use
"safe asserts". By default they don't show anything to the user,
just dump a message to the terminal and take the recovery branch
almost silently.

If you want to make these assert produce real warning messages you
should set a cmake option for it:

cmake -DHIDE_SAFE_ASSERTS=OFF .

This is highly recommended for developers, and not recommended for
painters who do real work of those builds of Krita.

Now rules when to use "safe" asserts. You can use them if the following
conditions are met:

1) The condition in the assert shows that a real *bug* has happened. It
   is not just a warning. It is a bug that should be fixed.

2) The recovery branch will *workaround* the bug and the user will be
   able to continue his work *as if nothing has happened*. Again, please
   mark the assert "safe" if and only if you are 100% sure Krita will
   not crash in a minute after you faced that bug. The user is not notified
   about this bug, so he is not going to take any emergency steps like
   saving his work and restarting Krita!

3) If you think that Krita should be better restarted after this bug,
   please use a usual KIS_ASSRT_RECOVER.

CC:kimageshop@kde.org
parent 20248e3f
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment