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: Sandro Santilli
Subject: Re: [Gnash-commit] [patch #8715] Patch for fixing callback registration issue in ExternalInterface
Date: Mon, 17 Aug 2015 10:22:56 +0200
User-agent: Mutt/1.5.21 (2010-09-15)

On Sun, Aug 16, 2015 at 11:14:58PM -0600, Richard Wilbur wrote:
> 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;
> +        }
> +

Good catch! We really need those tests in place...
Fixed by c5b657f

--strk; 



reply via email to

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