]> git.donarmstrong.com Git - lilypond.git/commitdiff
Issue 4357/2: Make dispatchers callable for dispatching
authorDavid Kastrup <dak@gnu.org>
Wed, 22 Apr 2015 12:44:15 +0000 (14:44 +0200)
committerDavid Kastrup <dak@gnu.org>
Tue, 12 May 2015 12:25:26 +0000 (14:25 +0200)
lily/dispatcher.cc
lily/include/listener.hh

index efb3ca506c0d2bcf2d533daeaee75f25acdd5a75..a394a4b7a80e0bd6017d3eca5e865e8fb8e442d4 100644 (file)
@@ -143,8 +143,8 @@ Dispatcher::dispatch (SCM sev)
           assert (lists[0].prio > last_priority);
           last_priority = lists[0].prio;
 
-          Listener *l = Listener::unsmob (scm_cdar (lists[0].list));
-          l->listen (ev->self_scm ());
+          SCM l = scm_cdar (lists[0].list);
+          scm_call_1 (l, ev->self_scm ());
 #if 0
           sent = true;
 #endif
index 959f7e510f1fa8b1c3a4d309b47b398756754f8e..3652a271b9b67dc66c60bbad3f2b48b1fb307653 100644 (file)
@@ -86,6 +86,12 @@ public:
 
   void listen (SCM ev) const;
 
+  LY_DECLARE_SMOB_PROC (1, 0, 0, (SCM self, SCM ev))
+  {
+    Listener::unsmob (self)->listen (ev);
+    return SCM_UNSPECIFIED;
+  }
+
   bool operator == (Listener const &other) const
   {
     return type_ == other.type_