Re: g_object_ref() now propagates types



On Fri, Dec 8, 2017 at 6:26 AM, Philip Withnall <philip tecnocode co uk> wrote:

child_type = CHILD_TYPE (g_object_ref (parent_type));

That will add a compile-time explicit cast, and a runtime type check.
(As always, the runtime type check is disabled if GLib is built without
debugging enabled (or with G_DISABLE_CAST_CHECKS defined.)

G_DISABLE_CAST_CHECKS is defined internally in GLib and GTK+ for stable releases (--enable-debug defaults to minimum for stable releases, yes for unstable releases), but that doesn't have any effect on whether they are enabled or disabled for your application; if you want to disable cast checks in production builds for your application, you need to specify G_DISABLE_CAST_CHECKS yourself.

Owen



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]