From: Chris Hanson Date: Fri, 7 Apr 2000 20:42:30 +0000 (+0000) Subject: Don't allow event receivers to be added twice. X-Git-Tag: 20090517-FFI~4077 X-Git-Url: https://birchwood-abbey.net/git?a=commitdiff_plain;h=ce22feae9c6f6b7f978fa11b53658c605e0942d5;p=mit-scheme.git Don't allow event receivers to be added twice. --- diff --git a/v7/src/runtime/events.scm b/v7/src/runtime/events.scm index cc2f4b98c..327c614b0 100644 --- a/v7/src/runtime/events.scm +++ b/v7/src/runtime/events.scm @@ -1,8 +1,8 @@ #| -*-Scheme-*- -$Id: events.scm,v 14.4 1999/01/02 06:11:34 cph Exp $ +$Id: events.scm,v 14.5 2000/04/07 20:42:30 cph Exp $ -Copyright (c) 1988-1999 Massachusetts Institute of Technology +Copyright (c) 1988-2000 Massachusetts Institute of Technology This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -72,10 +72,13 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. ((null? receivers)) (apply (car receivers) (cdr event)))) ((ADD-RECEIVER) - (set-event-distributor/receivers! - event-distributor - (append! (event-distributor/receivers event-distributor) - (list (cdr event))))) + (let ((receiver (cdr event)) + (receivers + (event-distributor/receivers event-distributor))) + (if (not (memv receiver receivers)) + (set-event-distributor/receivers! + event-distributor + (append! receivers (list receiver)))))) ((REMOVE-RECEIVER) (set-event-distributor/receivers! event-distributor