[seed] libseed: seed_signal_holder_get_property should return NULL if signal_name is not a signal, which wi



commit 00a5865da3bdcbb3d7288fed9c97ee8d82c33216
Author: Robert Carr <racarr svn gnome org>
Date:   Wed May 13 00:47:45 2009 -0400

    libseed: seed_signal_holder_get_property should return NULL if signal_name is not a signal, which will forward the get propert request to JSC
---
 libseed/seed-signals.c |   15 +++++++++++++--
 1 files changed, 13 insertions(+), 2 deletions(-)

diff --git a/libseed/seed-signals.c b/libseed/seed-signals.c
index 8102929..0ca3740 100644
--- a/libseed/seed-signals.c
+++ b/libseed/seed-signals.c
@@ -385,7 +385,7 @@ seed_signal_holder_get_property (JSContextRef ctx,
 				 JSValueRef *exception)
 {
   GObject *gobj = JSObjectGetPrivate (object);
-  signal_privates *priv = g_slice_alloc (sizeof (signal_privates));
+  signal_privates *priv;
   guint length = JSStringGetMaximumUTF8CStringSize (property_name);
   gchar *signal_name = g_malloc (length * sizeof (gchar));
   JSObjectRef signal_ref;
@@ -393,7 +393,18 @@ seed_signal_holder_get_property (JSContextRef ctx,
   JSStringGetUTF8CString (property_name, signal_name, length);
   
   if (!strcmp (signal_name, "connect") || !strcmp (signal_name, "disconnect"))
-    return NULL;
+    {
+      g_free (signal_name);
+      return NULL;
+    }
+  
+  if (!g_signal_lookup (signal_name, G_OBJECT_TYPE (gobj)))
+    {
+      g_free (signal_name);
+      return NULL;
+    }
+  
+  priv = g_slice_alloc (sizeof (signal_privates));
 
   priv->object = gobj;
   priv->signal_name = signal_name;



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