gnash-commit
[Top][All Lists]
Advanced

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

[Gnash-commit] [SCM] Gnash branch, master, updated. release_0_8_9_final-


From: Sandro Santilli
Subject: [Gnash-commit] [SCM] Gnash branch, master, updated. release_0_8_9_final-2194-g88f86a3
Date: Wed, 19 Aug 2015 10:31:52 +0000

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Gnash".

The branch, master has been updated
       via  88f86a3c63171283388f3644008763f2e6ab851b (commit)
      from  c5b657fc8486dba58737fcb8ce26db50dbe331a0 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://git.savannah.gnu.org/cgit//commit/?id=88f86a3c63171283388f3644008763f2e6ab851b


commit 88f86a3c63171283388f3644008763f2e6ab851b
Author: Nutchanon Wetchasit <address@hidden>
Date:   Wed Aug 19 11:57:22 2015 +0200

    Fix GC-related issue in ExternalInterface registration
    
    See https://savannah.gnu.org/bugs/?37223#comment10
    and https://savannah.gnu.org/patch/?8720
    
    Signed-off-by: Sandro Santilli <address@hidden>

diff --git a/NEWS b/NEWS
index 5168635..b0c21c3 100644
--- a/NEWS
+++ b/NEWS
@@ -2,6 +2,7 @@ Gnash 0.8.11
 YYYY/MM/DD
 
 Caveats:
+
 * The in-tree copy of jemalloc has been removed in preference to linking
   the system-installed jemalloc library.
 * The minimum required version of FFMPEG/libavcodec (if available) is
diff --git a/libcore/movie_root.cpp b/libcore/movie_root.cpp
index d3c8fdb..dbcdf1c 100644
--- a/libcore/movie_root.cpp
+++ b/libcore/movie_root.cpp
@@ -1766,6 +1766,26 @@ movie_root::markReachableResources() const
     // Mark LoadMovieRequest handlers as reachable
     _movieLoader.setReachable();
 
+    // Mark ExternalInterface callbacks and instances as reachable
+    for (std::map<std::string, as_object*>::const_iterator method_iterator
+             = _externalCallbackMethods.begin();
+         method_iterator != _externalCallbackMethods.end();
+         method_iterator++)
+    {
+        if (method_iterator->second != NULL) {
+            method_iterator->second->setReachable();
+        }
+    }
+    for (std::map<std::string, as_object*>::const_iterator instance_iterator
+             = _externalCallbackInstances.begin();
+         instance_iterator != _externalCallbackInstances.end();
+         instance_iterator++)
+    {
+        if (instance_iterator->second != NULL) {
+            instance_iterator->second->setReachable();
+        }
+    }
+
     // Mark resources reachable by queued action code
     for (size_t lvl = 0; lvl < PRIORITY_SIZE; ++lvl)
     {
@@ -1840,10 +1860,6 @@ movie_root::addExternalCallback(const std::string& name, 
as_object* callback,
         std::pair<std::string, as_object*>(name,instance)
     );
 
-    // Set callback and instance as reachable (avoid garbage collection)
-    if (callback!=NULL) callback->setReachable();
-    if (instance!=NULL) instance->setReachable();
-
     // When an external callback is added, we have to notify the plugin
     // that this method is available.
     if (_hostfd >= 0) {
diff --git a/libcore/movie_root.h b/libcore/movie_root.h
index 1fe163b..ed6ae37 100644
--- a/libcore/movie_root.h
+++ b/libcore/movie_root.h
@@ -563,6 +563,8 @@ public:
     /// - The original root movie (_rootMovie)
     /// - Mouse entities (m_mouse_button_state)
     /// - Timer targets (_intervalTimers)
+    /// - ExternalInterace callbacks (_externalCallbackMethods and
+    ///   _externalCallbackInstances)
     /// - Resources reachable by ActionQueue code (_actionQueue)
     /// - Any DisplayObject being dragged 
     void markReachableResources() const;

-----------------------------------------------------------------------

Summary of changes:
 NEWS                   |    1 +
 libcore/movie_root.cpp |   24 ++++++++++++++++++++----
 libcore/movie_root.h   |    2 ++
 3 files changed, 23 insertions(+), 4 deletions(-)


hooks/post-receive
-- 
Gnash



reply via email to

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