Skip to content

Instantly share code, notes, and snippets.

@splhack
Created December 13, 2013 18:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save splhack/7948983 to your computer and use it in GitHub Desktop.
Save splhack/7948983 to your computer and use it in GitHub Desktop.
diff --git a/csharp/unity/wrapper/LWFObject.cs b/csharp/unity/wrapper/LWFObject.cs
index c257411..b02054c 100644
--- a/csharp/unity/wrapper/LWFObject.cs
+++ b/csharp/unity/wrapper/LWFObject.cs
@@ -104,7 +104,8 @@ public class LWFObject : MonoBehaviour
{
isAlive = false;
- lwfDestroyCallbacks.ForEach(c => c(this));
+ foreach (var c in lwfDestroyCallbacks)
+ c(this);
lwfDestroyCallbacks = null;
if (lwfName == null)
@@ -210,7 +211,8 @@ public class LWFObject : MonoBehaviour
public virtual void OnLoad()
{
- lwfLoadCallbacks.ForEach(c => c(this));
+ foreach (var c in lwfLoadCallbacks)
+ c(this);
lwfLoadCallbacks = null;
}
@@ -637,7 +639,8 @@ public class LWFObject : MonoBehaviour
string instanceName, MovieEventHandler handler, bool immortal = false)
{
AddLoadCallback((o) => {
- MovieEventHandler h = (m) => {
+ MovieEventHandler h = nil;
+ h = (m) => {
if (!immortal)
lwf.RemoveMovieEventHandler(instanceName, load:h);
handler(m);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment