diff options
author | Matthias Clasen <mclasen@redhat.com> | 2015-09-07 03:02:11 -0400 |
---|---|---|
committer | Matthias Clasen <mclasen@redhat.com> | 2015-09-07 03:02:11 -0400 |
commit | 44af2b1c17b5920052a6bb363c62d8452a570a42 (patch) | |
tree | 3faf73c4f95e2f640724998580070805e4bcf98e | |
parent | f1f80111c9bb691c658e8657c450845387cbefd1 (diff) | |
download | glib-44af2b1c17b5920052a6bb363c62d8452a570a42.tar.gz |
Simplify g_param_spec_get_redirect_target a bit more
It is enough to look for exact matches here, so no need to
dive into g_type_instance_is_a and take locks, etc.
-rw-r--r-- | gobject/gparam.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/gobject/gparam.c b/gobject/gparam.c index bf2028e97..ec86766b4 100644 --- a/gobject/gparam.c +++ b/gobject/gparam.c @@ -579,7 +579,9 @@ g_param_spec_steal_qdata (GParamSpec *pspec, GParamSpec* g_param_spec_get_redirect_target (GParamSpec *pspec) { - if (G_IS_PARAM_SPEC_OVERRIDE (pspec)) + GTypeInstance *inst = (GTypeInstance *)pspec; + + if (inst && inst->g_class && inst->g_class->g_type == G_TYPE_PARAM_OVERRIDE) return ((GParamSpecOverride*)pspec)->overridden; else return NULL; |