diff --git a/gobject/gtype.c b/gobject/gtype.c index 72ddae25e..77feb7d4a 100644 --- a/gobject/gtype.c +++ b/gobject/gtype.c @@ -797,6 +797,13 @@ check_derivation_I (GType parent_type, type_descriptive_name_I (parent_type)); return FALSE; } + if (pnode->is_final) + { + g_critical ("cannot derive '%s' from final parent type '%s'", + type_name, + NODE_NAME (pnode)); + return FALSE; + } finfo = type_node_fundamental_info_I (pnode); /* ensure flat derivability */ if (!(finfo->type_flags & G_TYPE_FLAG_DERIVABLE)) @@ -815,13 +822,6 @@ check_derivation_I (GType parent_type, NODE_NAME (pnode)); return FALSE; } - if ((G_TYPE_FLAG_FINAL & GPOINTER_TO_UINT (type_get_qdata_L (pnode, static_quark_type_flags))) == G_TYPE_FLAG_FINAL) - { - g_critical ("cannot derive '%s' from final parent type '%s'", - type_name, - NODE_NAME (pnode)); - return FALSE; - } return TRUE; }