gnash-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Gnash-commit] [patch #8715] Patch for fixing callback registration


From: Richard Wilbur
Subject: Re: [Gnash-commit] [patch #8715] Patch for fixing callback registration issue in ExternalInterface
Date: Sun, 16 Aug 2015 23:14:58 -0600

diff --git a/libcore/movie_root.cpp b/libcore/movie_root.cpp
index 434f122..8d35546 100644
--- a/libcore/movie_root.cpp
+++ b/libcore/movie_root.cpp
@@ -1910,6 +1917,13 @@ movie_root::callExternalCallback(const std::string &name,
     } else {
         method = method_iterator->second;

+        // Look up for Object instance to use as "this" in the callback
+        instance_iterator = _externalCallbackInstances.find(name);
+        if (instance_iterator == _externalCallbackInstances.end()) {
+            instance = as_value((as_object*)NULL).to_object(getVM());
+        }
+        instance = instance_iterator->second;
+

In the code above instance is always set to instance_iterator->second.
Did you mean to do it in the following way?

+        // Look up for Object instance to use as "this" in the callback
+        instance_iterator = _externalCallbackInstances.find(name);
+        if (instance_iterator == _externalCallbackInstances.end()) {
+            instance = as_value((as_object*)NULL).to_object(getVM());
+        }
+        else {
+            instance = instance_iterator->second;
+        }
+



reply via email to

[Prev in Thread] Current Thread [Next in Thread]