On Saturday 07 June 2003 12:31, Levi Burton wrote:
> Would the gui/ code benefit from things such as the assert() macro?
Depends on what you have in mind. assert() is a debugging tool, you normally
don't ship code to production with those in. The purpose of assert() is to
turn the tracking of a potential bug from "very hard" to "trivial", not to
alleviate that bug in any way.
> If so, what would be an appropriate way of using it within the gui code?
Ideally we should try to find and fix all conditions leading to a crash, but
given the size and complexity of the code that's already beyond the realm of
humanly possible I'm afraid. So what's left is to try to recover as nicely as
possible from an internal error condition (null pointer tool, whatever) while
reporting it. That generally means
if (!ptr) {
KMessageBox:error("internal error, please report 'ptr was null' ");
return;
}
--
Guillaume.
http://www.telegraph-road.org
-------------------------------------------------------
This SF.net email is sponsored by: Etnus, makers of TotalView, The best
thread debugger on the planet. Designed with thread debugging features
you've never dreamed of, try TotalView 6 free at www.etnus.com.
_______________________________________________
Rosegarden-devel mailing list
[EMAIL PROTECTED] - use the link below to unsubscribe
https://lists.sourceforge.net/lists/listinfo/rosegarden-devel