Author: toshok
Date: 2008-01-23 22:50:49 -0500 (Wed, 23 Jan 2008)
New Revision: 93761

Modified:
   trunk/moon/plugin/ChangeLog
   trunk/moon/plugin/plugin-class.cpp
Log:
2008-01-23  Chris Toshok  <[EMAIL PROTECTED]>

        * plugin-class.cpp (EventListenerProxy::AddHandler): use the event
        id instead of the name for the destroyed event, and also don't try
        to add an event that doesn't exist for a given type.



Modified: trunk/moon/plugin/ChangeLog
===================================================================
--- trunk/moon/plugin/ChangeLog 2008-01-24 02:57:03 UTC (rev 93760)
+++ trunk/moon/plugin/ChangeLog 2008-01-24 03:50:49 UTC (rev 93761)
@@ -1,3 +1,9 @@
+2008-01-23  Chris Toshok  <[EMAIL PROTECTED]>
+
+       * plugin-class.cpp (EventListenerProxy::AddHandler): use the event
+       id instead of the name for the destroyed event, and also don't try
+       to add an event that doesn't exist for a given type.
+
 2008-10-11  Andrew Jorgensen  <[EMAIL PROTECTED]>
 
        * plugin-proxy.cpp: Add conditionals for ffmpeg inclusion

Modified: trunk/moon/plugin/plugin-class.cpp
===================================================================
--- trunk/moon/plugin/plugin-class.cpp  2008-01-24 02:57:03 UTC (rev 93760)
+++ trunk/moon/plugin/plugin-class.cpp  2008-01-24 03:50:49 UTC (rev 93761)
@@ -424,9 +424,16 @@
 {
        target_object = obj;
        
-       dtoken = obj->AddHandler ("destroyed", on_target_object_destroyed, 
this);
+       dtoken = obj->AddHandler (EventObject::DestroyedEvent, 
on_target_object_destroyed, this);
        
        event_id = obj->GetType()->LookupEvent (event_name);
+
+       if (event_id == -1) {
+               printf ("object of type `%s' does not provide an event named 
`%s'\n",
+                       obj->GetTypeName(), event_name);
+               return -1;
+       }
+
        token = obj->AddHandler (event_id, proxy_listener_to_javascript, this);
        return token;
 }

_______________________________________________
Mono-patches maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches

Reply via email to