From: Francesco Montorsi Date: Fri, 21 Mar 2008 18:04:00 +0000 (+0000) Subject: warn the user about using getters of objects in invalid state X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/f0a9a84c09e9c8a85617536d62400c469b6cc62c?ds=sidebyside warn the user about using getters of objects in invalid state git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@52653 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/docs/doxygen/overviews/refcount.h b/docs/doxygen/overviews/refcount.h index 8aab3dd2ff..48a2bf1bb7 100644 --- a/docs/doxygen/overviews/refcount.h +++ b/docs/doxygen/overviews/refcount.h @@ -53,7 +53,7 @@ provide comparison operators. Also note that if you only need to do a @c shallow comparison between two wxObject derived classes, you should not use the == and != operators but -rather the wxObject::IsSameAs function. +rather the wxObject::IsSameAs() function. @section overview_refcount_destruct Object Destruction @@ -90,6 +90,11 @@ operators and copy constructors since they are reference-counted: Note that the list above reports the objects which are reference counted in all ports of wxWidgets; some ports may use this technique also for other classes. +All the objects implement a function IsOk() to test if they are referencing valid +data; when the objects are in uninitialized state, you can only use the IsOk() getter; +trying to call any other getter, e.g. wxBrush::GetStyle() on the ::wxNullBrush object, +will result in an assert failure in debug builds. + @section overview_refcount_object Making Your Own Reference Counted Class