Re: Gotchya with sigslot library
Andrew Tetlaw <[email protected]>
| Newsgroups | gmane.comp.windows.devel.netwindows |
|---|---|
| Message-ID | <OFBFDCC4BC.180E7B75-ON4A256D9A.007D8167-4A256D9A.00813FFA@bvn.com.au> |
If I may contribute, Hopefully this is not too simplistic an answer: Instead of making the connections global they are local to each signal object. The previous version used the slot function pointer as a key to find the slot object in a global array whenever a signal was emitted. All the signal & slot objects and functions were wrapped in 'NW_SignalObj' class instances and stored in the connArr array with the function pointer as a key. The use of prototype level functions here caused an effect that could be perceived as a name-space conflict (but not exactly or consistantly) because all function pointers to prototype functions are identical and it pulled out the first match from connArr and applied it to what ever slot object it found there. The new one stores all the slots (object reference and function name) in the signal object itself. When the signal is emitted the array of slots (object & function) is simply applied. Much simpler and safer and basically just bypasses (perhaps 'fixes' is not the right word) the whole issue. > > I wasn't sure this was true, but my tests in Moz at least seem to be bearing > this out. The crux of the issue is the local vs. global implications of > function name rewriting. I am, however, a bit confused as to why the new > implementation "fixes" this while the old one didn't. Odd. > Alex Russell Cheers, Andrew Tetlaw Bligh Voller Nield http://www.bvn.com.au p: (07) 3251 5778 f: (07) 3852 2544 <font face="Arial, Helvetica, sans-serif" size="2"> <b> Please Also Note </b>This document, including attachments, is only intended for the addressees and may contain privileged or confidential information. Unauthorised use, copying or distribution of the document or any part of its contents, is prohibited. If you receive this Email in error please notify us by return Email or telephone. We will reimburse you for any reasonable expenses incurred in meeting this request.</font> _______________________________________________ The netWindows developers list: [email protected] http://netwindows.org/mailman/listinfo/devel_netwindows.org