mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2024-11-10 03:16:17 +01:00
gtype: Use is_final node bit to check if a type can be derived
This commit is contained in:
parent
5dc8d2ca00
commit
f6ac7bc907
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user