Andrej08
Joined: 31 Aug 2010 Posts: 51
|
Posted: Tue Aug 31, 2010 7:37 pm Post subject: Using delegates as event handlers |
|
|
Hi,
In the tutorial it states "To be on the safe side, your event handler callback delegate should always be a class method / member function.".
Is this referring to D1 only? D2 uses the technique where a delegate can be used even if it refers to stack-alocated variables, because it copies the referred variables on the heap. So unless something else is at play, it should be safe to use any delegate, in D2 at least.
Let me know if I missed something. |
|