URL:
  <http://gna.org/patch/?1533>

                 Summary: Invoke script error on duplicate connection in
script_signal_connect
                 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: 

    _______________________________________________________

Details:

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

<http://gna.org/patch/download.php?file_id=8527>

    _______________________________________________________

Reply to this item at:

  <http://gna.org/patch/?1533>

_______________________________________________
  Meddelandet skickades via/av Gna!
  http://gna.org/


_______________________________________________
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev

Reply via email to