Comment 8 for bug 1824587

Revision history for this message
John Beard (john-j-beard) wrote :

In principle it should be wxASSERT or friends, but it's in a paint event callback, so if it pops a dialog, it will all go a bit wrong, as the comment says:

    // DO NOT use wxASSERT, because GetClearance is called inside an OnPaint event
    // and a call to wxASSERT can crash the application.

Furthermore, as it happens on *every* paint event, a wxASSERT would be basically a system crash, as the application will be unusable for the hundreds of dialogs one after the other.

In this case, it's not critical debug (as it's been happening for a while), but it is still a "wrong" code path. I think wxLogDebug is an acceptable recourse to highlight the error without rendering the program unusable.