Summary: Invoke script error on duplicate connection in
                 Project: Freeciv
            Submitted by: englabenny
            Submitted on: söndag 2010-03-14 den 14:51
                Category: None
                Priority: 5 - Normal
                  Status: None
                 Privacy: Public
             Assigned to: None
        Originator Email: 
             Open/Closed: Open
         Discussion Lock: Any
         Planned Release: 



We raise a script error if a script connects the same callback
function to the same event twice.

Since the ruleset and the scenario share the same global namespace for
functions, it might happen that both define a function by the same
name, and register it for a callback. What happens then is that the
scenario function overshadows the ruleset function (which in itself
can be desireable), but the same function (scenario function) would
then be called twice for the event.

This makes signal.connect(..)  O(n) instead of O(1) where n is the number of
existing callbacks to the given event.


File Attachments:

Date: söndag 2010-03-14 den 14:51  Name:
0003-Invoke-script-error-on-duplicate-connection-in-scrip.patch  Size: 2 kB  
By: englabenny



Reply to this item at:


  Meddelandet skickades via/av Gna!

Freeciv-dev mailing list

Reply via email to