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. 2a2077e07868200fd695


From: Benjamin Wolsey
Subject: [Gnash-commit] [SCM] Gnash branch, master, updated. 2a2077e07868200fd69576cbe7cb83a276249fd5
Date: Fri, 08 Oct 2010 17:29:49 +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  2a2077e07868200fd69576cbe7cb83a276249fd5 (commit)
       via  f1f9cafb8f75f870db88b7ff86916ea936f8ee71 (commit)
       via  a32caea4677646b1f58b53498f600cf2495e59cf (commit)
       via  e2446f18e3e9d822af37dd977a242ac2baf19bc8 (commit)
       via  82a68c84d9f7a5a4194502ffd6dd853949ca06ff (commit)
       via  539ff491119f54c68507fad42868841bcf643d63 (commit)
       via  38f56030bd1155c043ff96a5f7f8702710b3a560 (commit)
       via  f88a731f1c4788344ebd04c6f7da154112c9c71e (commit)
       via  b5161cb32e3b45c33b96004a3b00411338344a2f (commit)
       via  1d9727abfd82f0d62533bb0071848478200924f1 (commit)
       via  415921adbcaae6a4c5b52b57036f91d035347128 (commit)
       via  21f912f53c9e490ba8de5d3ade5addb45d7cc8a7 (commit)
      from  f9bdf1e9b567ddfd4801d9d619d85e16370e0a9e (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=2a2077e07868200fd69576cbe7cb83a276249fd5


commit 2a2077e07868200fd69576cbe7cb83a276249fd5
Author: Benjamin Wolsey <address@hidden>
Date:   Fri Oct 8 19:08:48 2010 +0200

    Fix testsuite again.

diff --git a/testsuite/libcore.all/DisplayListTest.cpp 
b/testsuite/libcore.all/DisplayListTest.cpp
index d5308a4..d7e1c03 100644
--- a/testsuite/libcore.all/DisplayListTest.cpp
+++ b/testsuite/libcore.all/DisplayListTest.cpp
@@ -52,7 +52,7 @@ main(int /*argc*/, char** /*argv*/)
     
     RunResources ri;
     ri.setStreamProvider(
-            boost::shared_ptr<StreamProvider>(new StreamProvider(URL("")));
+            boost::shared_ptr<StreamProvider>(new StreamProvider(URL(""))));
     
     // Initialize a VM
     boost::intrusive_ptr<movie_definition> md5(new DummyMovieDefinition(ri, 
5));
diff --git a/testsuite/libcore.all/PropertyListTest.cpp 
b/testsuite/libcore.all/PropertyListTest.cpp
index 0da60a1..8add512 100644
--- a/testsuite/libcore.all/PropertyListTest.cpp
+++ b/testsuite/libcore.all/PropertyListTest.cpp
@@ -90,8 +90,8 @@ main(int /*argc*/, char** /*argv*/)
 
        log_debug("VM version %d", vm.getSWFVersion());
 
-       as_object obj(getGlobal(vm));
-       PropertyList props(obj);
+       as_object* obj = new as_object(getGlobal(vm));
+       PropertyList props(*obj);
 
        as_value val("value");
        as_value val2("value2");
@@ -106,22 +106,22 @@ main(int /*argc*/, char** /*argv*/)
                check ( props.setValue(st.find("Var0"), val) );
                check_equals(props.size(), 1);
 
-               check (getVal(props, st.find("Var0"), ret, obj) );
+               check (getVal(props, st.find("Var0"), ret, *obj) );
                check_strictly_equals ( ret, val );
 
                // search should be case-sensitive
-               check (!getVal(props, st.find("var0"), ret, obj) );
+               check (!getVal(props, st.find("var0"), ret, *obj) );
 
                // new value overrides existing value
                check ( props.setValue(st.find("Var0"), val2) );
                check_equals(props.size(), 1);
-               check (getVal(props, st.find("Var0"), ret, obj) );
+               check (getVal(props, st.find("Var0"), ret, *obj) );
                check_strictly_equals ( ret, val2 );
 
                // case-sensitive setting value doesn't overrides existing value
                check ( props.setValue(st.find("var0"), val3) );
                check_equals(props.size(), 2);
-               check (!getVal(props, st.find("vAr0"), ret, obj) );
+               check (!getVal(props, st.find("vAr0"), ret, *obj) );
 
                // Now add some new labels
                check ( props.setValue(st.find("var1"), val) );
@@ -160,23 +160,23 @@ main(int /*argc*/, char** /*argv*/)
                check ( props.setValue(st.find("Var0"), val) );
                check_equals(props.size(), 1);
 
-               check (getVal(props, st.find("Var0"), ret, obj) );
+               check (getVal(props, st.find("Var0"), ret, *obj) );
                check_strictly_equals ( ret, val );
 
                // search should be case-insensitive
-               check (getVal(props, st.find("var0"), ret, obj) );
+               check (getVal(props, st.find("var0"), ret, *obj) );
                check_strictly_equals ( ret, val );
 
                // new value overrides existing value
                check ( props.setValue(st.find("Var0"), val2) );
                check_equals(props.size(), 1);
-               check (getVal(props, st.find("Var0"), ret, obj) );
+               check (getVal(props, st.find("Var0"), ret, *obj) );
                check_strictly_equals ( ret, val2 );
 
                // case-insensitive setting value should override existing value
                check ( props.setValue(st.find("var0"), val3) );
                check_equals(props.size(), 1);
-               check (getVal(props, st.find("vAr0"), ret, obj) );
+               check (getVal(props, st.find("vAr0"), ret, *obj) );
                check_strictly_equals ( ret, val3 );
 
                // Now add some new labels

http://git.savannah.gnu.org/cgit//commit/?id=f1f9cafb8f75f870db88b7ff86916ea936f8ee71


commit f1f9cafb8f75f870db88b7ff86916ea936f8ee71
Author: Benjamin Wolsey <address@hidden>
Date:   Fri Oct 8 18:55:35 2010 +0200

    Another useless deregistration function.

diff --git a/libcore/asobj/XMLSocket_as.cpp b/libcore/asobj/XMLSocket_as.cpp
index 4cb39c4..e4b41d4 100644
--- a/libcore/asobj/XMLSocket_as.cpp
+++ b/libcore/asobj/XMLSocket_as.cpp
@@ -127,8 +127,6 @@ XMLSocket_as::XMLSocket_as(as_object* owner)
 
 XMLSocket_as::~XMLSocket_as()
 {
-    // Remove advance callback and close network connections.
-    close();
 }
 
 void

http://git.savannah.gnu.org/cgit//commit/?id=a32caea4677646b1f58b53498f600cf2495e59cf


commit a32caea4677646b1f58b53498f600cf2495e59cf
Author: Benjamin Wolsey <address@hidden>
Date:   Fri Oct 8 18:38:16 2010 +0200

    Documentation.

diff --git a/libbase/GC.h b/libbase/GC.h
index d53ff83..6f6d6bf 100644
--- a/libbase/GC.h
+++ b/libbase/GC.h
@@ -24,10 +24,6 @@
 #include <map>
 #include <string>
 
-#ifndef NDEBUG
-# include <boost/thread.hpp>
-#endif
-
 #include "dsodefs.h"
 
 // Define the following macro to enable GC verbosity 
@@ -49,19 +45,18 @@
 
 
 namespace gnash {
+    class GC;
+}
 
-class GC;
+namespace gnash {
 
 /// Abstract class to allow the GC to store "roots" into a container
 //
 /// Any class expected to act as a "root" for the garbage collection 
 /// should derive from this class, and implement the markReachableResources()
-/// method.
-///
-///
+/// function.
 class GcRoot
 {
-
 public:
 
     /// Scan all GC resources reachable by this instance.
@@ -71,7 +66,6 @@ public:
     ///
     /// Use setReachable() on the resources stored in this
     /// container.
-    ///
     virtual void markReachableResources() const=0;
 
     virtual ~GcRoot() {}
@@ -80,7 +74,6 @@ public:
 /// Collectable resource
 //
 /// Instances of this class can be managed by a GC object.
-///
 class GcResource
 {
 
@@ -88,35 +81,35 @@ public:
 
     friend class GC;
 
-    /// Create a Garbage-collected resource.
+    /// Create a Garbage-collected resource associated with a GC
     //
-    /// The resource will be automatically registered with
-    /// the garbage collector singleton.
-    ///
+    /// @param gc   The GC to register the resource with.
     GcResource(GC& gc);
 
-    /// \brief
-    /// Mark this resource as being reachable, possibly triggering
-    /// further marking of all resources reachable by this object.
+    /// Mark this resource as being reachable
+    //
+    /// This can trigger further marking of all resources reachable by this
+    /// object.
     //
     /// If the object wasn't reachable before, this call triggers
-    /// scan of all contained objects too...
-    ///
+    /// scan of all contained objects too.
     void setReachable() const
     {
 
-        if ( _reachable )
-        {
+        if (_reachable) {
+
 #if GNASH_GC_DEBUG > 2
-            log_debug(_("Instance %p of class %s already reachable, 
setReachable doing nothing"),
-                    (void*)this, typeName(*this));
+            log_debug(_("Instance %p of class %s already reachable, "
+                    "setReachable doing nothing"), (void*)this,
+                    typeName(*this));
 #endif
             return;
         }
 
 #if GNASH_GC_DEBUG  > 2
-        log_debug(_("Instance %p of class %s set to reachable, scanning 
reachable resources from it"),
-                (void*)this, typeid(*this).name());
+        log_debug(_("Instance %p of class %s set to reachable, scanning "
+                "reachable resources from it"), (void*)this,
+                typeName(*this));
 #endif
 
         _reachable = true;
@@ -149,7 +142,8 @@ protected:
     {
         assert(_reachable);
 #if GNASH_GC_DEBUG > 1
-        log_debug(_("Class %s didn't override the markReachableResources() 
method"), typeid(*this).name());
+        log_debug(_("Class %s didn't override the markReachableResources() "
+                    "method"), typeName(*this));
 #endif
     }
 
@@ -170,30 +164,26 @@ private:
 
 /// Garbage collector singleton
 //
-/// Instances of this class ( you' only use one, the singleton )
-/// manage a list of heap pointers (collectables) deleting them
-/// when no more needed/reachable.
-///
-/// Reachability of them is detected starting from a list
-/// of "root" containers each one expected to provide a
-/// function to return all reachable object.
-///
-/// Each "collectable" objects is also expected to be a container
-/// itself.
-///
+/// Instances of this class manage a list of heap pointers (collectables),
+/// deleting them when no more needed/reachable.
 ///
+/// Their reachability is detected starting from a root, which in turn
+/// marks all reachable resources.
 class DSOEXPORT GC
 {
 
 public:
 
-    /// Create a garbage collector, using the given root
+    /// Create a garbage collector using the given root
+    //
+    /// @param root     The top level of the GC, which takes care of marking
+    ///                 all further resources.
     GC(GcRoot& root);
 
     /// Destroy the collector, releasing all collectables.
     ~GC();
 
-    /// Add an heap object to the list of managed collectables
+    /// Add an object to the list of managed collectables
     //
     /// The given object is expected not to be already in the
     /// list. Failing to do so would just decrease performances
@@ -209,19 +199,18 @@ public:
     /// The item to be managed by this collector.
     /// Can't be NULL. The caller gives up ownerhip
     /// of it, which will only be deleted by this GC.
-    ///
     void addCollectable(const GcResource* item)
     {
 #ifndef NDEBUG
         assert(item);
-        assert(! item->isReachable());
-        // The following assertion is expensive ...
-        //assert(std::find(_resList.begin(), _resList.end(), item) == 
_resList.end());
+        assert(!item->isReachable());
 #endif
 
         _resList.push_back(item); ++_resListSize;
+
 #if GNASH_GC_DEBUG > 1
-        log_debug(_("GC: collectable %p added, num collectables: %d"), item, 
_resListSize);
+        log_debug(_("GC: collectable %p added, num collectables: %d"), item, 
+                _resListSize);
 #endif
     }
 
@@ -298,7 +287,6 @@ private:
     /// Delete all unreachable objects, and mark the others unreachable again
     //
     /// @return number of objects deleted
-    ///
     size_t cleanUnreachable();
 
     /// Number of newly registered collectable since last collection run
@@ -308,12 +296,10 @@ private:
     /// List of collectable resources
     ResList _resList;
 
-    // Size of the list above, to avoid the
-    // cost of computing it  ..
-    // .. this is O(n) on GNU stdc++ lib !
-    //
+    /// Size of the ResList to avoid the cost of computing it
     ResList::size_type _resListSize;
 
+    /// The GcRoot.
     GcRoot& _root;
 
     /// Number of resources in collectable list at end of last
diff --git a/libcore/vm/VM.cpp b/libcore/vm/VM.cpp
index baa5462..6e1b581 100644
--- a/libcore/vm/VM.cpp
+++ b/libcore/vm/VM.cpp
@@ -58,7 +58,8 @@ VM::VM(int version, movie_root& root, VirtualClock& clock)
        _swfversion(version),
        _clock(clock),
        _stack(),
-    _shLib(new SharedObjectLibrary(*this))
+    _shLib(new SharedObjectLibrary(*this)),
+    _rng(clock.elapsed())
 {
        NSV::loadStrings(_stringTable);
     _global->registerClasses();
@@ -76,10 +77,9 @@ VM::setSWFVersion(int v)
 }
 
 VM::RNG&
-VM::randomNumberGenerator() const
+VM::randomNumberGenerator() 
 {
-       static RNG rnd(_clock.elapsed());
-       return rnd;
+       return _rng;
 }
 
 const std::string&
diff --git a/libcore/vm/VM.h b/libcore/vm/VM.h
index 22d69a5..3af3697 100644
--- a/libcore/vm/VM.h
+++ b/libcore/vm/VM.h
@@ -174,12 +174,7 @@ public:
 
        // Get a pointer to the random number generator for
        // use by Math.random() and random().
-       //
-       // The seed is the system time in milliseconds at the first call
-       // to a random function. This allows a potentially variable amount
-       // of time to elapse between starting gnash and initialization of
-       // the generator, so decreasing predictability.
-       RNG& randomNumberGenerator() const;
+       RNG& randomNumberGenerator();
 
        /// Get a pointer to this VM's Root movie (stage)
        movie_root& getRoot() const;
@@ -305,6 +300,8 @@ private:
        /// Library of SharedObjects. Owned by the VM.
     std::auto_ptr<SharedObjectLibrary> _shLib;
 
+    RNG _rng;
+
 };
 
 /// A class to wrap frame access.  Stack allocating a frame guard
@@ -374,12 +371,33 @@ void subtract(as_value& op1, const as_value& op2, const 
VM& vm);
 /// @param vm       The VM executing the operation.
 as_value newLessThan(const as_value& op1, const as_value& op2, const VM& vm);
 
+/// Check if two values are equal
+//
+/// Note that conversions are performed as necessary, which can result in
+/// function calls, which can have any conceivable side effect. The order of
+/// the values affects the order the conversions are performed in, so can
+/// under some circumstances change the result of the comparison.
+//
+/// Equality comparisons depend strongly on the SWF version.
+//
+/// @param a    The first value to compare
+/// @param b    The second value to compare
+/// @param vm   The VM to use for the comparison.
+/// @return     Whether the values are considered equal.
 bool equals(const as_value& a, const as_value& b, const VM& vm);
 
 /// Convert an as_value to boolean type
+//
+/// @param val  The value to return as a boolean
+/// @param vm   The VM to use for the conversion.
+/// @return     The boolean value of the passed as_value.
 bool toBool(const as_value& v, const VM& vm);
 
-/// Convert an as_value to number type
+/// Convert an as_value to a double
+//
+/// @param val  The value to return as a double
+/// @param vm   The VM to use for the conversion.
+/// @return     The double value of the passed as_value.
 double toNumber(const as_value& v, const VM& vm);
 
 /// AS2-compatible conversion to 32bit integer
@@ -389,23 +407,43 @@ double toNumber(const as_value& v, const VM& vm);
 /// the stored number type.
 //
 /// This function calls to_number(), so performs a conversion if necessary.
+//
+/// @param val  The value to return as an int.
+/// @param vm   The VM to use for the conversion.
+/// @return     The integer value of the passed as_value.
 boost::int32_t toInt(const as_value& val, const VM& vm);
 
 /// Force type to number.
+//
+/// @param v    The value to change to a number type.
+/// @param vm   The VM to use for the conversion.
+/// @return     The value passed as v.
 as_value& convertToNumber(as_value& v, const VM& vm);
 
 /// Force type to string.
+//
+/// @param v    The value to change to a string type.
+/// @param vm   The VM to use for the conversion.
+/// @return     The value passed as v.
 as_value& convertToString(as_value& v, const VM& vm);
 
 /// Force type to bool.
+//
+/// @param v    The value to change to a bool type.
+/// @param vm   The VM to use for the conversion.
+/// @return     The value passed as v.
 as_value& convertToBoolean(as_value& v, const VM& vm);
 
-/// Convert to primitive type
+/// Convert to the appropriate primitive type
+//
+/// @param v    The value to change to a primitive type.
+/// @param vm   The VM to use for the conversion.
+/// @return     The value passed as v.
 as_value& convertToPrimitive(as_value& v, const VM& vm);
 
 } // namespace gnash
 
-#endif // GNASH_VM_H
+#endif
 
 // Local Variables:
 // mode: C++

http://git.savannah.gnu.org/cgit//commit/?id=e2446f18e3e9d822af37dd977a242ac2baf19bc8


commit e2446f18e3e9d822af37dd977a242ac2baf19bc8
Author: Benjamin Wolsey <address@hidden>
Date:   Fri Oct 8 18:05:00 2010 +0200

    Squash more silly cleanups.

diff --git a/libcore/asobj/LocalConnection_as.cpp 
b/libcore/asobj/LocalConnection_as.cpp
index f901359..a2f96d4 100644
--- a/libcore/asobj/LocalConnection_as.cpp
+++ b/libcore/asobj/LocalConnection_as.cpp
@@ -207,9 +207,7 @@ public:
     /// @param owner    The as_object that owns this Relay.
     LocalConnection_as(as_object* owner);
     
-    virtual ~LocalConnection_as() {
-        close();
-    }
+    virtual ~LocalConnection_as() {}
 
     /// Remove ourself as a listener (if connected).
     void close();
diff --git a/libcore/asobj/NetStream_as.cpp b/libcore/asobj/NetStream_as.cpp
index 11d4d74..b8dcacc 100644
--- a/libcore/asobj/NetStream_as.cpp
+++ b/libcore/asobj/NetStream_as.cpp
@@ -311,8 +311,6 @@ void adjust_volume(boost::int16_t* data, int size, int 
volume)
 
 NetStream_as::~NetStream_as()
 {
-    // close will also detach from sound handler
-    close();
 }
 
 
@@ -1042,7 +1040,7 @@ NetStream_as::pushDecodedAudioFrames(boost::uint32_t ts)
         if ( ! audio->m_size )
         {
             // Don't bother pushing an empty frame
-            // to the audio queue...
+            // to the audio Queue...
             log_debug("pushDecodedAudioFrames(%d): Decoded audio frame "
                     "contains no samples");
             delete audio;
diff --git a/libcore/vm/VM.cpp b/libcore/vm/VM.cpp
index a0b8257..baa5462 100644
--- a/libcore/vm/VM.cpp
+++ b/libcore/vm/VM.cpp
@@ -78,7 +78,6 @@ VM::setSWFVersion(int v)
 VM::RNG&
 VM::randomNumberGenerator() const
 {
-
        static RNG rnd(_clock.elapsed());
        return rnd;
 }

http://git.savannah.gnu.org/cgit//commit/?id=82a68c84d9f7a5a4194502ffd6dd853949ca06ff


commit 82a68c84d9f7a5a4194502ffd6dd853949ca06ff
Author: Benjamin Wolsey <address@hidden>
Date:   Fri Oct 8 17:47:51 2010 +0200

    Allow successive runs in gprocessor.

diff --git a/utilities/processor.cpp b/utilities/processor.cpp
index 14304f1..5d78b8e 100644
--- a/utilities/processor.cpp
+++ b/utilities/processor.cpp
@@ -342,16 +342,6 @@ main(int argc, char *argv[])
            exit(EXIT_FAILURE);
     }
 
-    if (infiles.size() > 1)
-    {
-        // We're not ready for multiple runs yet.
-        std::cerr << "Multiple input files not supported." << std::endl;
-        usage(argv[0]);
-        dbglogfile.removeLog();
-        exit(EXIT_FAILURE);
-    }
-
-
     boost::shared_ptr<gnash::media::MediaHandler> mediaHandler;
     boost::shared_ptr<sound::sound_handler> soundHandler;
 

http://git.savannah.gnu.org/cgit//commit/?id=539ff491119f54c68507fad42868841bcf643d63


commit 539ff491119f54c68507fad42868841bcf643d63
Author: Benjamin Wolsey <address@hidden>
Date:   Fri Oct 8 17:41:32 2010 +0200

    Documentation, remove useless functions.

diff --git a/libcore/movie_root.cpp b/libcore/movie_root.cpp
index 2024503..b9d4628 100644
--- a/libcore/movie_root.cpp
+++ b/libcore/movie_root.cpp
@@ -164,7 +164,6 @@ movie_root::movie_root(const movie_definition& def,
     _unnamedInstance(0),
     _movieLoader(*this)
 {
-    _vm.init();
     // This takes care of informing the renderer (if present) too.
     setQuality(QUALITY_HIGH);
 }
@@ -210,9 +209,6 @@ movie_root::~movie_root()
     clearIntervalTimers();
     _movieLoader.clear();
 
-    _vm.clear();
-    _gc.fuzzyCollect();
-
     assert(testInvariant());
 }
 
diff --git a/libcore/vm/VM.cpp b/libcore/vm/VM.cpp
index 6dae1b1..a0b8257 100644
--- a/libcore/vm/VM.cpp
+++ b/libcore/vm/VM.cpp
@@ -51,23 +51,17 @@ gnash::RcInitFile& rcfile = 
gnash::RcInitFile::getDefaultInstance();
 
 namespace gnash {
 
-void
-VM::init()
-{
-       NSV::loadStrings(_stringTable);
-    setGlobal(new Global_as(*this));
-    _global->registerClasses();
-}
-
 VM::VM(int version, movie_root& root, VirtualClock& clock)
        :
        _rootMovie(root),
-       _global(0),
+       _global(new Global_as(*this)),
        _swfversion(version),
        _clock(clock),
        _stack(),
     _shLib(new SharedObjectLibrary(*this))
 {
+       NSV::loadStrings(_stringTable);
+    _global->registerClasses();
        _clock.restart();
 }
 
@@ -76,16 +70,9 @@ VM::~VM()
 }
 
 void
-VM::clear()
-{
-    /// Reset the SharedObjectLibrary, so that SOLs are flushed.
-    _shLib.reset();
-}
-
-void
 VM::setSWFVersion(int v) 
 {
-       _swfversion=v;
+       _swfversion = v;
 }
 
 VM::RNG&
@@ -104,24 +91,22 @@ VM::getPlayerVersion() const
        return version;
 }
 
-const std::string
-VM::getOSName()
+std::string
+VM::getOSName() const
 {
 
        // The directive in gnashrc must override OS detection.
-       if (rcfile.getFlashSystemOS() != "")
-       {
+       if (rcfile.getFlashSystemOS() != "") {
                return rcfile.getFlashSystemOS();
        }
-       else
-       {
+       else {
 #ifdef HAVE_SYS_UTSNAME_H
 // For Linux- or UNIX-based systems (POSIX 4.4 conformant)
 
                struct utsname osname;
                std::string tmp;
                
-               uname (&osname);
+               uname(&osname);
                
                tmp = osname.sysname;
                tmp += " ";
@@ -136,8 +121,8 @@ VM::getOSName()
        }
 }
 
-const std::string
-VM::getSystemLanguage()
+std::string
+VM::getSystemLanguage() const
 {
 
        char *loc;
@@ -147,20 +132,12 @@ VM::getSystemLanguage()
        // This should work on most UNIX-like systems.
        // Callers should work out what to do with it.
        // TODO: Other OSs.
-       if ((loc = std::getenv("LANG")) ||
-               (loc = std::getenv("LANGUAGE")) ||
-               (loc = std::getenv("LC_MESSAGES"))
-               )
-       {
-               std::string lang = loc;
-               return lang;
+       if ((loc = std::getenv("LANG")) || (loc = std::getenv("LANGUAGE")) ||
+               (loc = std::getenv("LC_MESSAGES"))) {
+        return loc;
        }
        
-       else
-       {
-               // No string found
-               return "";
-       }
+    return std::string();
 }
 
 movie_root&
@@ -175,13 +152,6 @@ VM::getGlobal() const
        return _global;
 }
 
-void
-VM::setGlobal(Global_as* o)
-{
-       assert(!_global);
-       _global = o;
-}
-
 unsigned long int
 VM::getTime() const
 {
diff --git a/libcore/vm/VM.h b/libcore/vm/VM.h
index f5b51e6..22d69a5 100644
--- a/libcore/vm/VM.h
+++ b/libcore/vm/VM.h
@@ -80,35 +80,21 @@ public:
 
        typedef as_value (*as_c_function_ptr)(const fn_call& fn);
        
-    /// Use VM::get() to access the singleton
-       //
-       /// Initializes the GC singleton
-       ///
+       /// Initializes the VM
+    //
+    /// @param version      The initial version of the VM
+    /// @param root         The movie_root that owns this VM
+    /// @param clock        The clock to use for advances.
        VM(int version, movie_root& root, VirtualClock& clock);
 
-       /// Should deinitialize the GC singleton
-       /// If it doesn't is just because it corrupts memory :)
        ~VM();
 
-    /// \brief
-       /// Initialize the virtual machine singleton with the given
-       /// movie definition and return a reference to it.
-       //
-       /// The given movie will be only used to fetch SWF version from.
-       ///
-       /// Don't call this function twice, and make sure you have
-       /// called this *before* you call VM::get()
-       ///
-       /// @param movie
-       ///     The definition for the root movie, only
-       ///     used to fetch SWF version from.
-       ///     TODO: take SWF version directly ?
-       ///
-       /// @param clock
-       ///     Virtual clock used as system time.
-       ///
+    /// Initialize VM resources
        void init();
 
+    /// Accessor for the VM's stack
+    //
+    /// TODO: drop
        SafeStack<as_value>& getStack() {
                return _stack;
        }
@@ -119,7 +105,6 @@ public:
     /// but maybe accessing it trough VM isn't the best idea.
     /// TODO: consider making this accessible trough RunResources
     /// instead.
-    ///
     VirtualClock& getClock() {
         return _clock;
     }
@@ -163,12 +148,12 @@ public:
        /// defined in gnashrc, that takes precedence. For Linux, the string
        /// includes the kernel version (unname -sr). Only works for systems
        /// with sys/utsname.h (POSIX 4.4).
-       const std::string getOSName();
+       std::string getOSName() const;
        
        /// Return the current language of the system. This is used for
        /// System.capabilities.language. Only works for systems with 
        /// a language environment variable.
-       const std::string getSystemLanguage();
+       std::string getSystemLanguage() const;
        
        // The boost Random Number Generator to use.
        //
@@ -301,12 +286,6 @@ private:
        /// Target SWF version
        int _swfversion;
 
-       /// Set the _global Object for actions run by Virtual Machine
-       //
-       /// Will be called by the init() function
-       /// 
-       void setGlobal(Global_as*);
-
        typedef std::map<unsigned int, as_c_function_ptr> FuncMap;
        typedef std::map<unsigned int, FuncMap> AsNativeTable;
        AsNativeTable _asNativeTable;

http://git.savannah.gnu.org/cgit//commit/?id=38f56030bd1155c043ff96a5f7f8702710b3a560


commit 38f56030bd1155c043ff96a5f7f8702710b3a560
Author: Benjamin Wolsey <address@hidden>
Date:   Fri Oct 8 17:18:50 2010 +0200

    Don't access other GC resources in GC resource dtors or cleanup is
    impossible.

diff --git a/libcore/Relay.cpp b/libcore/Relay.cpp
index e774ed4..7b2af24 100644
--- a/libcore/Relay.cpp
+++ b/libcore/Relay.cpp
@@ -26,7 +26,6 @@ namespace gnash {
 /// Destructor of ActiveRelay needs definition of movie_root.
 ActiveRelay::~ActiveRelay()
 {
-    getRoot(*_owner).removeAdvanceCallback(this);
 }
 
 
diff --git a/libcore/asobj/Sound_as.cpp b/libcore/asobj/Sound_as.cpp
index 44b3ee4..e437cb9 100644
--- a/libcore/asobj/Sound_as.cpp
+++ b/libcore/asobj/Sound_as.cpp
@@ -265,10 +265,7 @@ Sound_as::Sound_as(as_object* owner)
 
 Sound_as::~Sound_as()
 {
-
     // Just in case...
-    stopProbeTimer();
-
     if (_inputStream && _soundHandler) {
         _soundHandler->unplugInputStream(_inputStream);
         _inputStream=0;

http://git.savannah.gnu.org/cgit//commit/?id=f88a731f1c4788344ebd04c6f7da154112c9c71e


commit f88a731f1c4788344ebd04c6f7da154112c9c71e
Author: Benjamin Wolsey <address@hidden>
Date:   Fri Oct 8 17:10:14 2010 +0200

    Add vm accessor to MovieTester, use it.

diff --git a/testsuite/MovieTester.h b/testsuite/MovieTester.h
index aff2a4d..53fa49e 100644
--- a/testsuite/MovieTester.h
+++ b/testsuite/MovieTester.h
@@ -207,6 +207,11 @@ public:
        void checkPixel(int x, int y, unsigned radius, const rgba& color,
                        short unsigned tolerance, const std::string& label, 
bool expectFailure=false) const;
 
+    VM& vm() {
+        assert(_movie_root);
+        return _movie_root->getVM();
+    }
+
        /// Notify mouse button was pressed
        void pressMouseButton();
 
diff --git a/testsuite/misc-ming.all/DefineTextTest-Runner.cpp 
b/testsuite/misc-ming.all/DefineTextTest-Runner.cpp
index db9eb27..54046d3 100644
--- a/testsuite/misc-ming.all/DefineTextTest-Runner.cpp
+++ b/testsuite/misc-ming.all/DefineTextTest-Runner.cpp
@@ -112,7 +112,8 @@ main(int /*argc*/, char** /*argv*/)
 
        for (int i=0; i<3; ++i) tester.advance(); // get to the end
 
-       string_table& st = VM::get().getStringTable();
+       string_table& st = tester.vm().getStringTable();
+
        as_value eot;
        bool endOfTestFound = getObject(root)->get_member(st.find("endoftest"), 
&eot);
        xcheck(endOfTestFound);
diff --git a/testsuite/misc-ming.all/NetStream-SquareTestRunner.cpp 
b/testsuite/misc-ming.all/NetStream-SquareTestRunner.cpp
index 6b58722..df1248e 100644
--- a/testsuite/misc-ming.all/NetStream-SquareTestRunner.cpp
+++ b/testsuite/misc-ming.all/NetStream-SquareTestRunner.cpp
@@ -65,7 +65,7 @@ main(int /*argc*/, char** /*argv*/)
        // When all possible tests are implemented as self-contained, we'll
        // add tests that can't be self-contained.
        //
-       string_table& st = VM::get().getStringTable();
+       string_table& st = tester.vm().getStringTable();
        string_table::key k = st.find("startNotified");
        as_value tmp;
        while (!getObject(root)->get_member(k, &tmp) )
diff --git a/testsuite/misc-ming.all/attachMovieTestRunner.cpp 
b/testsuite/misc-ming.all/attachMovieTestRunner.cpp
index d75f4be..61386f4 100644
--- a/testsuite/misc-ming.all/attachMovieTestRunner.cpp
+++ b/testsuite/misc-ming.all/attachMovieTestRunner.cpp
@@ -79,9 +79,9 @@ main(int /*argc*/, char** /*argv*/)
        // check that the pixel under the mouse is white
        check_pixel(100, 30, 2, rgba(255,255,255,255), 2);
 
-    VM& vm = VM::get();
+       VM& vm = tester.vm();
 
-       string_table& st = VM::get().getStringTable();
+       string_table& st = vm.getStringTable();
 
        getObject(root)->get_member(st.find("mousedown"), &tmp);
        check(tmp.is_undefined());
diff --git a/testsuite/misc-ming.all/intervalTestRunner.cpp 
b/testsuite/misc-ming.all/intervalTestRunner.cpp
index 7fc62fb..3d42ea9 100644
--- a/testsuite/misc-ming.all/intervalTestRunner.cpp
+++ b/testsuite/misc-ming.all/intervalTestRunner.cpp
@@ -61,7 +61,7 @@ main(int /*argc*/, char** /*argv*/)
 
        // Now timers are set and counters initialized
 
-       VM& vm = VM::get();
+       VM& vm = tester.vm();
        string_table& st = vm.getStringTable();
        getObject(root)->get_member(st.find("this_counter"), &tmp);
        check_equals(toNumber(tmp, vm), 0);
diff --git a/testsuite/movies.all/gravity_embedded-TestRunner.cpp 
b/testsuite/movies.all/gravity_embedded-TestRunner.cpp
index c65b58b..d130bd1 100644
--- a/testsuite/movies.all/gravity_embedded-TestRunner.cpp
+++ b/testsuite/movies.all/gravity_embedded-TestRunner.cpp
@@ -68,9 +68,9 @@ main(int /*argc*/, char** /*argv*/)
        check(loaded);
        check_equals(loaded->parent(), root);
 
-    VM& vm = VM::get();
+    VM& vm = tester.vm();
 
-       string_table& st = VM::get().getStringTable();
+       string_table& st = vm.getStringTable();
        string_table::key xscale = st.find("_xscale");
        string_table::key yscale = st.find("_yscale");
        // we need a const_cast as get_member *might* eventually

http://git.savannah.gnu.org/cgit//commit/?id=b5161cb32e3b45c33b96004a3b00411338344a2f


commit b5161cb32e3b45c33b96004a3b00411338344a2f
Author: Benjamin Wolsey <address@hidden>
Date:   Fri Oct 8 15:53:50 2010 +0200

    Drop GC singleton

diff --git a/cygnal/cvm.cpp b/cygnal/cvm.cpp
index 233e3b6..31690f7 100644
--- a/cygnal/cvm.cpp
+++ b/cygnal/cvm.cpp
@@ -212,9 +212,6 @@ FsCommandExecutor execFsCommand;
 int
 vm_main(int argc, char *argv[])
 {
-    /// Initialize gnash core library
-    gnashInit();
-
     // Enable native language support, i.e. internationalization
 #ifdef ENABLE_NLS
     std::setlocale (LC_ALL, "");
diff --git a/gui/gtk/gtk_glue.h b/gui/gtk/gtk_glue.h
index 2ead6d7..3c4f164 100644
--- a/gui/gtk/gtk_glue.h
+++ b/gui/gtk/gtk_glue.h
@@ -30,10 +30,12 @@
 #include <gdk/gdk.h>
 #endif
 
-namespace gnash
-{
+namespace gnash {
+    class Renderer;
+    class movie_root;
+}
 
-class Renderer;
+namespace gnash {
 
 class GtkGlue
 {
diff --git a/gui/gui.cpp b/gui/gui.cpp
index d5cb9df..bdfd0cf 100644
--- a/gui/gui.cpp
+++ b/gui/gui.cpp
@@ -1169,7 +1169,7 @@ Gui::getMovieInfo() const
     //
     topIter = tr->insert(topIter, StringPair("GC Statistics", ""));
     GC::CollectablesCount cc;
-    GC::get().countCollectables(cc);
+    _stage->gc().countCollectables(cc);
     
     const std::string lbl = "GC managed ";
     for (GC::CollectablesCount::iterator i=cc.begin(), e=cc.end(); i!=e; ++i) {
diff --git a/gui/pythonmod/gnash-view.cpp b/gui/pythonmod/gnash-view.cpp
index a241fc4..f20fc48 100644
--- a/gui/pythonmod/gnash-view.cpp
+++ b/gui/pythonmod/gnash-view.cpp
@@ -456,7 +456,6 @@ gnash_view_load_movie(GnashView *view, const gchar *uri)
     view->virtual_clock.reset(new 
gnash::InterruptableVirtualClock(*view->system_clock));
     view->stage.reset(new gnash::movie_root(*view->movie_definition, 
*view->virtual_clock, *view->run_info));
     
-    gnash::gnashInit(*view->stage);
     view->movie_definition->completeLoad();
 
     view->advance_timer = g_timeout_add_full(G_PRIORITY_LOW, 10,
diff --git a/libbase/GC.cpp b/libbase/GC.cpp
index 87d60c6..7eeafdf 100644
--- a/libbase/GC.cpp
+++ b/libbase/GC.cpp
@@ -28,29 +28,25 @@
 
 namespace gnash {
 
-GC* GC::_singleton = NULL;
-unsigned int GC::maxNewCollectablesCount = 64;
-
-GC&
-GC::init(GcRoot& root)
+GC::GC(GcRoot& root)
+    :
+    _maxNewCollectablesCount(0),
+    _resListSize(0),
+    _root(root),
+    _lastResCount(0)
+#ifdef GNASH_GC_DEBUG 
+    , _collectorRuns(0)
+#endif
 {
-    assert(!_singleton);
-    _singleton = new GC(root);
+#ifdef GNASH_GC_DEBUG 
+    log_debug(_("GC %p created"), (void*)this);
+#endif
     char *gcgap = std::getenv("GNASH_GC_TRIGGER_THRESHOLD");
-    if ( gcgap )
+    if (gcgap)
     {
-        unsigned int gap = strtoul(gcgap, NULL, 0);
-        _singleton->maxNewCollectablesCount = gap;
+        unsigned int gap = std::strtoul(gcgap, NULL, 0);
+        _maxNewCollectablesCount = gap;
     }
-    return *_singleton;
-}
-
-void
-GC::cleanup()
-{
-    assert(_singleton);
-    delete _singleton;
-    _singleton = NULL;
 }
 
 GC::~GC()
@@ -116,14 +112,9 @@ GC::runCycle()
 #endif
 
 #ifdef GNASH_GC_DEBUG 
-    log_debug(_("GC: collection cycle started - %d/%d new resources allocated 
since last run (from %d to %d)"), _resListSize-_lastResCount, 
maxNewCollectablesCount, _lastResCount, _resListSize);
+    log_debug(_("GC: collection cycle started - %d/%d new resources allocated 
since last run (from %d to %d)"), _resListSize-_lastResCount, 
_maxNewCollectablesCount, _lastResCount, _resListSize);
 #endif // GNASH_GC_DEBUG
 
-#ifndef NDEBUG
-    boost::thread self;
-    assert(self == mainThread);
-#endif
-
     // Mark all resources as reachable
     markReachable();
 
diff --git a/libbase/GC.h b/libbase/GC.h
index 7211e1f..d53ff83 100644
--- a/libbase/GC.h
+++ b/libbase/GC.h
@@ -93,7 +93,7 @@ public:
     /// The resource will be automatically registered with
     /// the garbage collector singleton.
     ///
-    GcResource();
+    GcResource(GC& gc);
 
     /// \brief
     /// Mark this resource as being reachable, possibly triggering
@@ -187,25 +187,11 @@ class DSOEXPORT GC
 
 public:
 
-    /// Init the singleton instance using the given GcRoot
-    //
-    static GC& init(GcRoot& r);
-
-    /// Delete the singleton. You'll need to call init() again
-    /// after this call, if you want to use the singleton.
-    //
-    /// See init(GcRoot&)
-    ///
-    static void cleanup();
+    /// Create a garbage collector, using the given root
+    GC(GcRoot& root);
 
-    /// Get the singleton 
-    //
-    /// An assertion will fail if the GC has not been initialized yet.
-    /// See init(GcRoot&).
-    ///
-    static GC& get() {
-        return *_singleton;
-    }
+    /// Destroy the collector, releasing all collectables.
+    ~GC();
 
     /// Add an heap object to the list of managed collectables
     //
@@ -227,8 +213,6 @@ public:
     void addCollectable(const GcResource* item)
     {
 #ifndef NDEBUG
-        boost::thread self;
-        assert(self == mainThread);
         assert(item);
         assert(! item->isReachable());
         // The following assertion is expensive ...
@@ -273,10 +257,12 @@ public:
         //    runtime analisys
         //
 
-        if ( _resListSize <  _lastResCount + maxNewCollectablesCount )
-        {
+        if (_resListSize <  _lastResCount + _maxNewCollectablesCount) {
 #if GNASH_GC_DEBUG  > 1
-            log_debug(_("GC: collection cycle skipped - %d/%d new resources 
allocated since last run (from %d to %d)"), _resListSize-_lastResCount, 
maxNewCollectablesCount, _lastResCount, _resListSize);
+            log_debug(_("GC: collection cycle skipped - %d/%d new resources "
+                        "allocated since last run (from %d to %d)"),
+                    _resListSize-_lastResCount, _maxNewCollectablesCount,
+                    _lastResCount, _resListSize);
 #endif // GNASH_GC_DEBUG
             return;
         }
@@ -297,28 +283,6 @@ public:
 
 private:
 
-    /// Number of newly registered collectable since last collection run
-    /// triggering next collection.
-    static unsigned int maxNewCollectablesCount;
-
-    /// Create a garbage collector, using the given root
-    GC(GcRoot& root)
-        :
-        _resListSize(0),
-        _root(root),
-        _lastResCount(0)
-#ifdef GNASH_GC_DEBUG 
-        , _collectorRuns(0)
-#endif
-    {
-#ifdef GNASH_GC_DEBUG 
-        log_debug(_("GC %p created"), (void*)this);
-#endif
-    }
-
-    /// Destroy the collector, releasing all collectables.
-    ~GC();
-
     /// List of collectables
     typedef std::list<const GcResource *> ResList;
 
@@ -337,6 +301,10 @@ private:
     ///
     size_t cleanUnreachable();
 
+    /// Number of newly registered collectable since last collection run
+    /// triggering next collection.
+    size_t _maxNewCollectablesCount;
+
     /// List of collectable resources
     ResList _resList;
 
@@ -348,15 +316,6 @@ private:
 
     GcRoot& _root;
 
-    static GC* _singleton;
-
-#ifndef NDEBUG
-    /// The thread that initialized the GC is 
-    /// the only one allowed to run the collector
-    /// and to register collectable objects
-    boost::thread mainThread;
-#endif
-
     /// Number of resources in collectable list at end of last
     /// collect() call.
     ResList::size_type _lastResCount;
@@ -368,11 +327,11 @@ private:
 };
 
 
-inline GcResource::GcResource()
+inline GcResource::GcResource(GC& gc)
     :
     _reachable(false)
 {
-    GC::get().addCollectable(this);
+    gc.addCollectable(this);
 }
 
 } // namespace gnash
diff --git a/libcore/DisplayObject.cpp b/libcore/DisplayObject.cpp
index cf7c3db..f03c7da 100644
--- a/libcore/DisplayObject.cpp
+++ b/libcore/DisplayObject.cpp
@@ -86,6 +86,7 @@ const int DisplayObject::noClipDepthValue;
 DisplayObject::DisplayObject(movie_root& mr, as_object* object,
         DisplayObject* parent)
     :
+    GcResource(mr.gc()),
     _name(),
     _parent(parent),
     _object(object),
diff --git a/libcore/URLAccessManager.cpp b/libcore/URLAccessManager.cpp
index 947d0ce..8740f08 100644
--- a/libcore/URLAccessManager.cpp
+++ b/libcore/URLAccessManager.cpp
@@ -20,8 +20,6 @@
 #include "URL.h"
 #include "log.h"
 #include "StringPredicates.h" 
-#include "VM.h" 
-#include "movie_root.h" 
 #include "rc.h" // for rcfile
 #include "GnashSystemNetHeaders.h"
 
diff --git a/libcore/as_object.cpp b/libcore/as_object.cpp
index cfaa9c5..6aaeeba 100644
--- a/libcore/as_object.cpp
+++ b/libcore/as_object.cpp
@@ -287,6 +287,7 @@ const int as_object::DefaultFlags;
 
 as_object::as_object(const Global_as& gl)
     :
+    GcResource(getRoot(gl).gc()),
     _displayObject(0),
     _array(false),
     _relay(0),
@@ -297,6 +298,7 @@ as_object::as_object(const Global_as& gl)
 
 as_object::as_object(VM& vm)
     :
+    GcResource(vm.getRoot().gc()),
     _displayObject(0),
     _array(false),
     _relay(0),
diff --git a/libcore/gnash.h b/libcore/gnash.h
index aae8c5d..de90fd8 100644
--- a/libcore/gnash.h
+++ b/libcore/gnash.h
@@ -28,10 +28,6 @@
 
 /// Freedom bites
 namespace gnash {
-    class movie_root;
-}
-
-namespace gnash {
 
 /// The display quality.
 //
@@ -44,10 +40,6 @@ enum Quality
     QUALITY_BEST
 };
 
-/// Initialize gnash core library
-//
-DSOEXPORT void gnashInit(movie_root& mr);
-
 /// Maximum release of resources. 
 //
 /// Calls clear_library() and
diff --git a/libcore/impl.cpp b/libcore/impl.cpp
index 9be92cb..9f472d7 100644
--- a/libcore/impl.cpp
+++ b/libcore/impl.cpp
@@ -76,42 +76,6 @@ void  clear()
     MovieFactory::movieLibrary.clear();
     fontlib::clear();
 
-#ifdef GNASH_USE_GC 
-    GC::get().fuzzyCollect(); // why would this be needed ?
-
-    GC::cleanup();
-#endif
-
-}
-
-#ifdef GNASH_USE_GC
-/// A GC root used to mark all reachable collectable pointers
-class GnashGcRoot : public GcRoot 
-{
-
-public:
-
-  GnashGcRoot(movie_root& mr)
-      :
-      _mr(mr)
-  {
-  }
-
-  void markReachableResources() const
-  {
-    _mr.markReachableResources();
-  }
-private:
-  movie_root& _mr;
-};
-#endif
-
-void gnashInit(movie_root& mr)
-{
-#ifdef GNASH_USE_GC
-  static GnashGcRoot gcRoot(mr);
-  GC::init(gcRoot);
-#endif
 }
 
 } // namespace gnash
diff --git a/libcore/movie_root.cpp b/libcore/movie_root.cpp
index c47b23e..2024503 100644
--- a/libcore/movie_root.cpp
+++ b/libcore/movie_root.cpp
@@ -128,6 +128,7 @@ private:
 movie_root::movie_root(const movie_definition& def,
         VirtualClock& clock, const RunResources& runResources)
     :
+    _gc(*this),
     _runResources(runResources),
     _vm(def.get_version(), *this, clock),
     _interfaceHandler(0),
@@ -163,7 +164,6 @@ movie_root::movie_root(const movie_definition& def,
     _unnamedInstance(0),
     _movieLoader(*this)
 {
-    gnashInit(*this);
     _vm.init();
     // This takes care of informing the renderer (if present) too.
     setQuality(QUALITY_HIGH);
@@ -211,6 +211,7 @@ movie_root::~movie_root()
     _movieLoader.clear();
 
     _vm.clear();
+    _gc.fuzzyCollect();
 
     assert(testInvariant());
 }
@@ -289,7 +290,7 @@ movie_root::cleanupAndCollect()
     _vm.getStack().clear();
 
     cleanupDisplayList();
-    GC::get().fuzzyCollect();
+    _gc.fuzzyCollect();
 }
 
 /* private */
@@ -541,7 +542,7 @@ movie_root::clear()
 
 #ifdef GNASH_USE_GC
     // Run the garbage collector again
-    GC::get().fuzzyCollect();
+    _gc.fuzzyCollect();
 #endif
 
     setInvalidated();
diff --git a/libcore/movie_root.h b/libcore/movie_root.h
index 7a2b990..b433741 100644
--- a/libcore/movie_root.h
+++ b/libcore/movie_root.h
@@ -79,6 +79,7 @@
 #include "SimpleBuffer.h" // for LoadCallback
 #include "MovieLoader.h"
 #include "ExternalInterface.h"
+#include "GC.h"
 
 #ifdef USE_SWFTREE
 # include "tree.hh"
@@ -144,7 +145,7 @@ struct DepthComparator
 /// hosting application.
 //
 /// The _root object is provided by getAsRoot().
-class DSOEXPORT movie_root : boost::noncopyable
+class DSOEXPORT movie_root : public GcRoot, boost::noncopyable
 {
 public:
     
@@ -887,6 +888,10 @@ public:
     /// onUnload handler.
     void removeQueuedConstructor(DisplayObject* target);
 
+    GC& gc() {
+        return _gc;
+    }
+
 private:
 
     /// Set the root movie, replacing the current one if any.
@@ -922,18 +927,6 @@ private:
     /// more info.
     bool fire_mouse_event();
 
-    const RunResources& _runResources; 
-
-    /// This initializes a SharedObjectLibrary, which requires 
-    /// _originalURL, so that must be initialized first.
-    VM _vm;
-
-    /// Registered Interface command handler, if any
-    AbstractIfaceCallback* _interfaceHandler;
-
-    /// Registered FsCommand handler, if any
-    AbstractFsCallback* _fsCommandHandler;
-
     /// Take care of dragging, if needed
     void doMouseDrag();
 
@@ -1019,6 +1012,20 @@ private:
 
     void handleActionLimitHit(const std::string& ref);
 
+    GC _gc;
+
+    const RunResources& _runResources; 
+
+    /// This initializes a SharedObjectLibrary, which requires 
+    /// _originalURL, so that must be initialized first.
+    VM _vm;
+
+    /// Registered Interface command handler, if any
+    AbstractIfaceCallback* _interfaceHandler;
+
+    /// Registered FsCommand handler, if any
+    AbstractFsCallback* _fsCommandHandler;
+
     /// A list of AdvanceableCharacters
     //
     /// This is a list (not a vector) as we want to allow
diff --git a/libcore/vm/VM.cpp b/libcore/vm/VM.cpp
index bb9d9e3..6dae1b1 100644
--- a/libcore/vm/VM.cpp
+++ b/libcore/vm/VM.cpp
@@ -55,11 +55,8 @@ void
 VM::init()
 {
        NSV::loadStrings(_stringTable);
-
-    Global_as* gl(new Global_as(*this));
-
-       setGlobal(gl);
-    gl->registerClasses();
+    setGlobal(new Global_as(*this));
+    _global->registerClasses();
 }
 
 VM::VM(int version, movie_root& root, VirtualClock& clock)
diff --git a/plugin/win32/plugin.cpp b/plugin/win32/plugin.cpp
index 380fac0..c8b4a87 100644
--- a/plugin/win32/plugin.cpp
+++ b/plugin/win32/plugin.cpp
@@ -394,7 +394,6 @@ nsPluginInstance::threadMain(void)
        PR_Lock(playerLock);
 
     // Initialize Gnash core library.
-    gnash::gnashInit();
     DBG("Gnash core initialized.\n");
  
     // Init logfile.
diff --git a/testsuite/libcore.all/AsValueTest.cpp 
b/testsuite/libcore.all/AsValueTest.cpp
index 76e8621..9a90314 100644
--- a/testsuite/libcore.all/AsValueTest.cpp
+++ b/testsuite/libcore.all/AsValueTest.cpp
@@ -122,7 +122,6 @@ main(int argc, char *argv[])
     ManualClock clock;
 
     movie_root stage(*md, clock, runResources);
-    gnashInit(stage);
 
     MovieClip::MovieVariables v;
     // We pass 'v' twice, as the second one is for scriptable
diff --git a/testsuite/libcore.all/DisplayListTest.cpp 
b/testsuite/libcore.all/DisplayListTest.cpp
index 871a496..d5308a4 100644
--- a/testsuite/libcore.all/DisplayListTest.cpp
+++ b/testsuite/libcore.all/DisplayListTest.cpp
@@ -49,7 +49,6 @@ main(int /*argc*/, char** /*argv*/)
     dbglogfile.setVerbosity();
     
     // Initialize gnash lib
-    gnashInit();
     
     RunResources ri;
     ri.setStreamProvider(
@@ -61,7 +60,6 @@ main(int /*argc*/, char** /*argv*/)
     
     ManualClock clock;
     movie_root stage(*md5, clock, ri);
-    gnashInit(stage);
     
     MovieClip::MovieVariables v;
     // We pass 'v' twice, as the second one is for scriptable
diff --git a/testsuite/libcore.all/PropertyListTest.cpp 
b/testsuite/libcore.all/PropertyListTest.cpp
index 146d762..0da60a1 100644
--- a/testsuite/libcore.all/PropertyListTest.cpp
+++ b/testsuite/libcore.all/PropertyListTest.cpp
@@ -80,7 +80,6 @@ main(int /*argc*/, char** /*argv*/)
        ManualClock clock;
 
     movie_root root(*md5, clock, runResources);
-    gnashInit(root);
 
     // We pass MovieClip::MovieVariables() twice, as the second one is
     // for scriptable Variables, which isn't fully implemented yet.

http://git.savannah.gnu.org/cgit//commit/?id=1d9727abfd82f0d62533bb0071848478200924f1


commit 1d9727abfd82f0d62533bb0071848478200924f1
Author: Benjamin Wolsey <address@hidden>
Date:   Fri Oct 8 15:18:14 2010 +0200

    Drop VM singleton.

diff --git a/gui/Player.cpp b/gui/Player.cpp
index 4654e83..ac635b4 100644
--- a/gui/Player.cpp
+++ b/gui/Player.cpp
@@ -107,7 +107,6 @@ Player::Player()
     _startFullscreen(false),
     _hideMenu(false)
 {
-    init();
 }
 
 float
@@ -119,14 +118,6 @@ Player::setScale(float newscale)
 }
 
 void
-Player::init()
-{
-    /// Initialize gnash core library
-    gnashInit();
-
-}
-
-void
 Player::init_logfile()
 {
     dbglogfile.setWriteDisk(false);
diff --git a/gui/gtk/gtk.cpp b/gui/gtk/gtk.cpp
index bd1d84c..1375cdb 100644
--- a/gui/gtk/gtk.cpp
+++ b/gui/gtk/gtk.cpp
@@ -946,7 +946,7 @@ GtkGui::createWindow(int width, int height)
 void
 GtkGui::beforeRendering()
 {
-    gnash_canvas_before_rendering(GNASH_CANVAS(_canvas));
+    gnash_canvas_before_rendering(GNASH_CANVAS(_canvas), getStage());
 }
 
 void
diff --git a/gui/gtk/gtk_canvas.cpp b/gui/gtk/gtk_canvas.cpp
index 60e1f76..26f6a71 100644
--- a/gui/gtk/gtk_canvas.cpp
+++ b/gui/gtk/gtk_canvas.cpp
@@ -313,9 +313,9 @@ gnash_canvas_setup(GnashCanvas *canvas, std::string& 
hwaccel,
 }
 
 void
-gnash_canvas_before_rendering(GnashCanvas *canvas)
+gnash_canvas_before_rendering(GnashCanvas *canvas, gnash::movie_root* stage)
 {
-    canvas->glue->beforeRendering();
+    canvas->glue->beforeRendering(stage);
 }
 
 boost::shared_ptr<gnash::Renderer>
diff --git a/gui/gtk/gtk_canvas.h b/gui/gtk/gtk_canvas.h
index 15684df..5c1a2f2 100644
--- a/gui/gtk/gtk_canvas.h
+++ b/gui/gtk/gtk_canvas.h
@@ -27,6 +27,7 @@
 // Forward declarations.
 namespace gnash {
     class Renderer;
+    class movie_root;
 }
 
 G_BEGIN_DECLS
@@ -49,7 +50,7 @@ GType            gnash_canvas_get_type              ();
 GtkWidget       *gnash_canvas_new                   ();
 
 void             gnash_canvas_setup                 (GnashCanvas *canvas, 
std::string &hwaccel, std::string &renderer, int argc, char **argv[]);
-void             gnash_canvas_before_rendering      (GnashCanvas *canvas);
+void             gnash_canvas_before_rendering      (GnashCanvas *canvas, 
gnash::movie_root* stage);
 boost::shared_ptr<gnash::Renderer>  gnash_canvas_get_renderer   (GnashCanvas 
*canvas);
 
 G_END_DECLS
diff --git a/gui/gtk/gtk_glue.h b/gui/gtk/gtk_glue.h
index bd8aef2..2ead6d7 100644
--- a/gui/gtk/gtk_glue.h
+++ b/gui/gtk/gtk_glue.h
@@ -71,7 +71,7 @@ class GtkGlue
     virtual void configure(GtkWidget *const widget,
             GdkEventConfigure *const event) = 0;
     
-    virtual void beforeRendering() {};
+    virtual void beforeRendering(movie_root*) {};
 
   protected:
     GtkWidget *_drawing_area;
diff --git a/gui/gtk/gtk_glue_agg.cpp b/gui/gtk/gtk_glue_agg.cpp
index 729666c..d19daa8 100644
--- a/gui/gtk/gtk_glue_agg.cpp
+++ b/gui/gtk/gtk_glue_agg.cpp
@@ -128,7 +128,7 @@ GtkAggGlue::setRenderHandlerSize(int width, int height)
 }
 
 void 
-GtkAggGlue::beforeRendering()
+GtkAggGlue::beforeRendering(movie_root*)
 {
     if (_offscreenbuf && _offscreenbuf->type == GDK_IMAGE_SHARED) {
          gdk_flush();
diff --git a/gui/gtk/gtk_glue_agg.h b/gui/gtk/gtk_glue_agg.h
index d9a50d3..155e4d3 100644
--- a/gui/gtk/gtk_glue_agg.h
+++ b/gui/gtk/gtk_glue_agg.h
@@ -40,7 +40,7 @@ class GtkAggGlue : public GtkGlue
     void prepDrawingArea(GtkWidget *drawing_area);
     Renderer* createRenderHandler();
     void setRenderHandlerSize(int width, int height);
-    void beforeRendering();
+    virtual void beforeRendering(movie_root* stage);
     void render();
     void render(int minx, int miny, int maxx, int maxy);
     void configure(GtkWidget *const widget, GdkEventConfigure *const event);
diff --git a/gui/gtk/gtk_glue_agg_vaapi.cpp b/gui/gtk/gtk_glue_agg_vaapi.cpp
index 0f5392b..1532834 100644
--- a/gui/gtk/gtk_glue_agg_vaapi.cpp
+++ b/gui/gtk/gtk_glue_agg_vaapi.cpp
@@ -257,19 +257,18 @@ GtkAggVaapiGlue::setRenderHandlerSize(int width, int 
height)
 }
 
 void 
-GtkAggVaapiGlue::beforeRendering()
+GtkAggVaapiGlue::beforeRendering(movie_root* stage)
 {
     // Process all GDK pending operations
     gdk_flush();
 
     if (USE_HW_SCALING) {
-        movie_root & stage = VM::get().getRoot();
 
         static bool first = true;
-        if (first && VM::isInitialized()) {
+        if (first && stage) {
             first = false;
 
-            Movie const & mi = stage.getRootMovie();
+            Movie const & mi = stage->getRootMovie();
             const unsigned int width  = mi.widthPixels();
             const unsigned int height = mi.heightPixels();
             resetRenderSurface(width, height);
diff --git a/gui/gtk/gtk_glue_agg_vaapi.h b/gui/gtk/gtk_glue_agg_vaapi.h
index 000e36f..a04a65f 100644
--- a/gui/gtk/gtk_glue_agg_vaapi.h
+++ b/gui/gtk/gtk_glue_agg_vaapi.h
@@ -39,6 +39,7 @@ class VaapiSubpicture;
 class VaapiRectangle;
 class VaapiVideoWindow;
 class Renderer_agg_base;
+class movie_root;
 
 class GtkAggVaapiGlue : public GtkGlue
 {
@@ -50,7 +51,7 @@ public:
     void prepDrawingArea(GtkWidget *drawing_area);
     Renderer* createRenderHandler();
     void setRenderHandlerSize(int width, int height);
-    void beforeRendering();
+    virtual void beforeRendering(movie_root* stage);
     void render();
     void render(GdkRegion * const);
     void configure(GtkWidget *const widget, GdkEventConfigure *const event);
diff --git a/gui/gtk/gtk_glue_agg_xv.cpp b/gui/gtk/gtk_glue_agg_xv.cpp
index a09f739..1f80f87 100644
--- a/gui/gtk/gtk_glue_agg_xv.cpp
+++ b/gui/gtk/gtk_glue_agg_xv.cpp
@@ -118,13 +118,13 @@ GtkAggXvGlue::createRenderHandler()
 }
 
 void
-GtkAggXvGlue::setupRendering()
+GtkAggXvGlue::setupRendering(movie_root* stage)
 {
     static bool first = true;
-    if (first && VM::isInitialized()) {
+    if (first && stage) {
         first = false;
         
-        const Movie& mi = VM::get().getRoot().getRootMovie();
+        const Movie& mi = stage->getRootMovie();
     
         _movie_width = mi.widthPixels();
         _movie_height = mi.heightPixels();        
@@ -166,9 +166,9 @@ GtkAggXvGlue::setupRendering()
 
 
 void 
-GtkAggXvGlue::beforeRendering()
+GtkAggXvGlue::beforeRendering(movie_root* stage)
 {
-    setupRendering();
+    setupRendering(stage);
     
     // We force the scale to its original state in case the GUI changed it (in
     // the event of a resize), because we want Xv to do the scaling for us.    
diff --git a/gui/gtk/gtk_glue_agg_xv.h b/gui/gtk/gtk_glue_agg_xv.h
index 73ed0f0..3f6104b 100644
--- a/gui/gtk/gtk_glue_agg_xv.h
+++ b/gui/gtk/gtk_glue_agg_xv.h
@@ -47,7 +47,7 @@ class GtkAggXvGlue : public GtkGlue
     bool init(int argc, char **argv[]);
     void prepDrawingArea(GtkWidget *drawing_area);
     Renderer* createRenderHandler();
-    void beforeRendering();
+    virtual void beforeRendering(movie_root* stage);
     void render();
     void render(int minx, int miny, int maxx, int maxy);
     void configure(GtkWidget *const widget, GdkEventConfigure *const event);
@@ -58,7 +58,7 @@ class GtkAggXvGlue : public GtkGlue
     bool create_xv_image(unsigned int width, unsigned int height);
     bool create_xv_shmimage(unsigned int width, unsigned int height);
     void destroy_x_image();
-    void setupRendering();
+    void setupRendering(movie_root* stage);
     void decode_mask(unsigned long mask, unsigned int *shift, unsigned int 
*size);
     bool isFormatBetter(const XvImageFormatValues& oldformat,
                         const XvImageFormatValues& newformat);
diff --git a/gui/gui.cpp b/gui/gui.cpp
index 4f942c3..d5cb9df 100644
--- a/gui/gui.cpp
+++ b/gui/gui.cpp
@@ -265,7 +265,7 @@ Gui::restart()
 void
 Gui::updateStageMatrix()
 {
-    if ( ! VM::isInitialized() ) {
+    if (!_stage) {
         // When VM initializes, we'll get a call to resize_view, which
         // would call us again.
         //log_debug("Can't update stage matrix till VM is initialized");
@@ -423,14 +423,9 @@ Gui::resize_view(int width, int height)
        assert(width>0);
        assert(height>0);
 
-       if ( VM::isInitialized() )
-       {
-
-               if (_stage && _started) {
-                       _stage->setDimensions(width, height);
-               }
-
-       }
+    if (_stage && _started) {
+        _stage->setDimensions(width, height);
+    }
 
        _width = width;
        _height = height;
@@ -1099,7 +1094,7 @@ Gui::getMovieInfo() const
 {
     std::auto_ptr<InfoTree> tr;
 
-    if (! VM::isInitialized()) {
+    if (!_stage) {
         return tr;
     }
 
diff --git a/gui/gui.h b/gui/gui.h
index bbdde69..690715b 100644
--- a/gui/gui.h
+++ b/gui/gui.h
@@ -472,7 +472,7 @@ public:
     void setStage(movie_root* stage);
 
     /// The root movie, or "Stage"
-    movie_root *getStage() { return _stage; };
+    movie_root* getStage() { return _stage; };
     
     /// Handle error message from the core
     //
diff --git a/gui/pythonmod/gnash-view.cpp b/gui/pythonmod/gnash-view.cpp
index 74a6b9e..a241fc4 100644
--- a/gui/pythonmod/gnash-view.cpp
+++ b/gui/pythonmod/gnash-view.cpp
@@ -206,7 +206,6 @@ gnash_view_init(GnashView *view)
 
     // Initializations that can happen before realization come here. The rest
     // come after realize, in gnash_view_realize_cb.
-    gnash::gnashInit();
     gnash::LogFile& dbglogfile = gnash::LogFile::getDefaultInstance();
     dbglogfile.setVerbosity(3);
 
@@ -456,6 +455,8 @@ gnash_view_load_movie(GnashView *view, const gchar *uri)
     view->system_clock.reset(new gnash::SystemClock());
     view->virtual_clock.reset(new 
gnash::InterruptableVirtualClock(*view->system_clock));
     view->stage.reset(new gnash::movie_root(*view->movie_definition, 
*view->virtual_clock, *view->run_info));
+    
+    gnash::gnashInit(*view->stage);
     view->movie_definition->completeLoad();
 
     view->advance_timer = g_timeout_add_full(G_PRIORITY_LOW, 10,
@@ -505,7 +506,7 @@ gnash_view_display(GnashView *view)
     renderer->set_invalidated_regions(changed_ranges);
     gdk_window_invalidate_rect(GTK_WIDGET(view->canvas)->window, NULL, false);
 
-    gnash_canvas_before_rendering(view->canvas);
+    gnash_canvas_before_rendering(view->canvas, view->stage.get());
        view->stage->display();
 
     gdk_window_process_updates(GTK_WIDGET(view->canvas)->window, false);
diff --git a/libcore/FreetypeGlyphsProvider.cpp 
b/libcore/FreetypeGlyphsProvider.cpp
index 0662d10..55a9dae 100644
--- a/libcore/FreetypeGlyphsProvider.cpp
+++ b/libcore/FreetypeGlyphsProvider.cpp
@@ -529,10 +529,13 @@ FreetypeGlyphsProvider::getGlyph(boost::uint16_t code, 
float& advance)
 
     FT_Outline_Decompose(outline, &walk, &walker);
 #ifdef DEBUG_OUTLINE_DECOMPOSITION 
+#if 0
+    // Don't use VM::get if this is to be re-enabled.
     SWFRect bound; sh->compute_bound(&bound, VM::get().getSWFVersion());
     log_debug("Decomposed glyph for DisplayObject '%c' has bounds %s",
             code, bound.toString());
 #endif
+#endif
 
     walker.finish();
 
diff --git a/libcore/URLAccessManager.cpp b/libcore/URLAccessManager.cpp
index 13613da..947d0ce 100644
--- a/libcore/URLAccessManager.cpp
+++ b/libcore/URLAccessManager.cpp
@@ -146,15 +146,12 @@ local_check(const std::string& path, const URL& baseUrl)
     assert( ! path.empty() );
 
     // Don't allow local access if starting movie is a network resource.
-    if ( VM::isInitialized() )
-    {
-       if (baseUrl.protocol() != "file") {
-          log_security(_("Load of file %s forbidden"
-              " (starting url %s is not a local resource)"),
-              path, baseUrl.str());
-          return false;
-       }
-    } // else we didn't start yet, so path *is* the starting movie
+   if (baseUrl.protocol() != "file") {
+      log_security(_("Load of file %s forbidden"
+          " (starting url %s is not a local resource)"),
+          path, baseUrl.str());
+      return false;
+   }
 
     RcInitFile& rcfile = RcInitFile::getDefaultInstance();
     
diff --git a/libcore/gnash.h b/libcore/gnash.h
index 381083c..aae8c5d 100644
--- a/libcore/gnash.h
+++ b/libcore/gnash.h
@@ -28,7 +28,10 @@
 
 /// Freedom bites
 namespace gnash {
+    class movie_root;
+}
 
+namespace gnash {
 
 /// The display quality.
 //
@@ -43,7 +46,7 @@ enum Quality
 
 /// Initialize gnash core library
 //
-DSOEXPORT void gnashInit();
+DSOEXPORT void gnashInit(movie_root& mr);
 
 /// Maximum release of resources. 
 //
diff --git a/libcore/impl.cpp b/libcore/impl.cpp
index d6e6cc1..9be92cb 100644
--- a/libcore/impl.cpp
+++ b/libcore/impl.cpp
@@ -35,6 +35,7 @@
 #include "VM.h"
 #include "MovieLibrary.h"
 #include "gnash.h" // DSOEXPORTS
+#include "movie_root.h"
 
 #ifdef GNASH_USE_GC
 #include "GC.h"
@@ -72,8 +73,6 @@ void  clear()
     log_debug("Any segfault past this message is likely due to improper "
             "threads cleanup.");
 
-    VM::get().clear();
-
     MovieFactory::movieLibrary.clear();
     fontlib::clear();
 
@@ -92,21 +91,25 @@ class GnashGcRoot : public GcRoot
 
 public:
 
-  GnashGcRoot()
+  GnashGcRoot(movie_root& mr)
+      :
+      _mr(mr)
   {
   }
 
   void markReachableResources() const
   {
-    VM::get().markReachableResources();
+    _mr.markReachableResources();
   }
+private:
+  movie_root& _mr;
 };
 #endif
 
-void gnashInit()
+void gnashInit(movie_root& mr)
 {
 #ifdef GNASH_USE_GC
-  static GnashGcRoot gcRoot;
+  static GnashGcRoot gcRoot(mr);
   GC::init(gcRoot);
 #endif
 }
diff --git a/libcore/movie_root.cpp b/libcore/movie_root.cpp
index dd91ce3..c47b23e 100644
--- a/libcore/movie_root.cpp
+++ b/libcore/movie_root.cpp
@@ -129,7 +129,7 @@ movie_root::movie_root(const movie_definition& def,
         VirtualClock& clock, const RunResources& runResources)
     :
     _runResources(runResources),
-    _vm(VM::init(def.get_version(), *this, clock)),
+    _vm(def.get_version(), *this, clock),
     _interfaceHandler(0),
     _fsCommandHandler(0),
     _stageWidth(1),
@@ -163,6 +163,8 @@ movie_root::movie_root(const movie_definition& def,
     _unnamedInstance(0),
     _movieLoader(*this)
 {
+    gnashInit(*this);
+    _vm.init();
     // This takes care of informing the renderer (if present) too.
     setQuality(QUALITY_HIGH);
 }
@@ -208,6 +210,8 @@ movie_root::~movie_root()
     clearIntervalTimers();
     _movieLoader.clear();
 
+    _vm.clear();
+
     assert(testInvariant());
 }
 
@@ -1707,6 +1711,8 @@ movie_root::executeTimers()
 void
 movie_root::markReachableResources() const
 {
+    _vm.markReachableResources();
+
     foreachSecond(_movies.rbegin(), _movies.rend(), &MovieClip::setReachable);
 
     // Mark original top-level movie
diff --git a/libcore/movie_root.h b/libcore/movie_root.h
index 34da49f..7a2b990 100644
--- a/libcore/movie_root.h
+++ b/libcore/movie_root.h
@@ -926,7 +926,7 @@ private:
 
     /// This initializes a SharedObjectLibrary, which requires 
     /// _originalURL, so that must be initialized first.
-    VM& _vm;
+    VM _vm;
 
     /// Registered Interface command handler, if any
     AbstractIfaceCallback* _interfaceHandler;
diff --git a/libcore/vm/VM.cpp b/libcore/vm/VM.cpp
index 64650f1..bb9d9e3 100644
--- a/libcore/vm/VM.cpp
+++ b/libcore/vm/VM.cpp
@@ -51,40 +51,15 @@ gnash::RcInitFile& rcfile = 
gnash::RcInitFile::getDefaultInstance();
 
 namespace gnash {
 
-// Pointer to our singleton
-std::auto_ptr<VM> VM::_singleton;
-
-VM&
-VM::init(int version, movie_root& root, VirtualClock& clock)
+void
+VM::init()
 {
-       // Don't call more then once !
-       assert(!_singleton.get());
-
-       _singleton.reset(new VM(version, root, clock));
+       NSV::loadStrings(_stringTable);
 
-       assert(_singleton.get());
-       NSV::loadStrings(_singleton->_stringTable);
+    Global_as* gl(new Global_as(*this));
 
-    Global_as* gl(new Global_as(*_singleton));
-
-       _singleton->setGlobal(gl);
+       setGlobal(gl);
     gl->registerClasses();
-
-       return *_singleton;
-}
-
-VM&
-VM::get()
-{
-       // Did you call VM::init ?
-       assert(_singleton.get());
-       return *_singleton;
-}
-
-bool
-VM::isInitialized()
-{
-       return _singleton.get();
 }
 
 VM::VM(int version, movie_root& root, VirtualClock& clock)
@@ -222,8 +197,6 @@ VM::markReachableResources() const
     std::for_each(_globalRegisters.begin(), _globalRegisters.end(), 
             std::mem_fun_ref(&as_value::setReachable));
 
-       _rootMovie.markReachableResources();
-
        _global->setReachable();
 
     if (_shLib.get()) _shLib->markReachableResources();
@@ -326,12 +299,6 @@ VM::popCallFrame()
 }
 
 void
-VmGcRoot::markReachableResources() const
-{
-       _vm.markReachableResources();
-}
-
-void
 VM::registerNative(Global_as::ASFunction fun, unsigned int x, unsigned int y)
 {
     assert(fun);
diff --git a/libcore/vm/VM.h b/libcore/vm/VM.h
index 27898de..f5b51e6 100644
--- a/libcore/vm/VM.h
+++ b/libcore/vm/VM.h
@@ -57,17 +57,6 @@ namespace gnash {
 
 namespace gnash {
 
-/// A GC root used to mark all reachable collectable pointers
-class VmGcRoot : public GcRoot 
-{
-public:
-       VmGcRoot(VM& vm) : _vm(vm) {}
-       virtual void markReachableResources() const;
-
-private:
-    VM& _vm;
-};
-
 /// The AVM1 virtual machine
 //
 /// The VM class has no code for execution, but rather stores the resources
@@ -90,6 +79,16 @@ class DSOEXPORT VM : boost::noncopyable
 public:
 
        typedef as_value (*as_c_function_ptr)(const fn_call& fn);
+       
+    /// Use VM::get() to access the singleton
+       //
+       /// Initializes the GC singleton
+       ///
+       VM(int version, movie_root& root, VirtualClock& clock);
+
+       /// Should deinitialize the GC singleton
+       /// If it doesn't is just because it corrupts memory :)
+       ~VM();
 
     /// \brief
        /// Initialize the virtual machine singleton with the given
@@ -108,7 +107,7 @@ public:
        /// @param clock
        ///     Virtual clock used as system time.
        ///
-       static VM& init(int version, movie_root& root, VirtualClock& clock);
+       void init();
 
        SafeStack<as_value>& getStack() {
                return _stack;
@@ -125,9 +124,6 @@ public:
         return _clock;
     }
 
-       /// Return true if the singleton VM has been initialized
-       static bool isInitialized();
-
     /// Resets any VM members that must be cleared before the GC cleans up
     //
     /// At present, this is:
@@ -139,15 +135,6 @@ public:
     /// dtor.
     void clear();
 
-       /// Get the singleton instance of the virtual machine
-       //
-       /// Make sure you called VM::init() before trying to
-       /// get the singleton (an assertion would fail otherwise)
-       ///
-       /// Use isInitialized() if you're unsure.
-       ///
-       static VM& get();
-
        /// Get SWF version context for the currently running actions.
        //
        /// This information will drive operations of the virtual machine
@@ -305,23 +292,6 @@ public:
 
 private:
 
-       friend class VmGcRoot;
-
-       /// Use VM::get() to access the singleton
-       //
-       /// Initializes the GC singleton
-       ///
-       VM(int version, movie_root& root, VirtualClock& clock);
-
-       /// Should deinitialize the GC singleton
-       /// If it doesn't is just because it corrupts memory :)
-       ~VM();
-
-       // We use an auto_ptr here to allow constructing
-       // the singleton when the init() function is called.
-       friend class std::auto_ptr<VM>;
-       static std::auto_ptr<VM> _singleton;
-
        /// Stage associated with this VM
        movie_root& _rootMovie;
 
diff --git a/testsuite/MovieTester.cpp b/testsuite/MovieTester.cpp
index 3953c87..92ce425 100644
--- a/testsuite/MovieTester.cpp
+++ b/testsuite/MovieTester.cpp
@@ -75,9 +75,6 @@ MovieTester::MovieTester(const std::string& url)
     _forceRedraw(true)
 {
     
-    // Initialize gnash code lib
-    gnashInit();
-    
     // Initialize the testing media handlers
     initTestingMediaHandlers();
     
diff --git a/testsuite/libcore.all/AsValueTest.cpp 
b/testsuite/libcore.all/AsValueTest.cpp
index b6f41cc..76e8621 100644
--- a/testsuite/libcore.all/AsValueTest.cpp
+++ b/testsuite/libcore.all/AsValueTest.cpp
@@ -111,7 +111,6 @@ main(int argc, char *argv[])
     }
 
     // Initialize gnash lib
-    gnashInit();
     
     RunResources runResources;
     runResources.setStreamProvider(
@@ -123,6 +122,7 @@ main(int argc, char *argv[])
     ManualClock clock;
 
     movie_root stage(*md, clock, runResources);
+    gnashInit(stage);
 
     MovieClip::MovieVariables v;
     // We pass 'v' twice, as the second one is for scriptable
diff --git a/testsuite/libcore.all/DisplayListTest.cpp 
b/testsuite/libcore.all/DisplayListTest.cpp
index eb8d9a3..871a496 100644
--- a/testsuite/libcore.all/DisplayListTest.cpp
+++ b/testsuite/libcore.all/DisplayListTest.cpp
@@ -61,6 +61,7 @@ main(int /*argc*/, char** /*argv*/)
     
     ManualClock clock;
     movie_root stage(*md5, clock, ri);
+    gnashInit(stage);
     
     MovieClip::MovieVariables v;
     // We pass 'v' twice, as the second one is for scriptable
diff --git a/testsuite/libcore.all/PropertyListTest.cpp 
b/testsuite/libcore.all/PropertyListTest.cpp
index 71ab3c0..146d762 100644
--- a/testsuite/libcore.all/PropertyListTest.cpp
+++ b/testsuite/libcore.all/PropertyListTest.cpp
@@ -65,9 +65,6 @@ main(int /*argc*/, char** /*argv*/)
        gnash::LogFile& dbglogfile = gnash::LogFile::getDefaultInstance();
        dbglogfile.setVerbosity();
 
-       // Initialize gnash lib
-       gnashInit();
-
     // We don't care about the base URL.
     RunResources runResources;
     runResources.setStreamProvider(
@@ -83,6 +80,7 @@ main(int /*argc*/, char** /*argv*/)
        ManualClock clock;
 
     movie_root root(*md5, clock, runResources);
+    gnashInit(root);
 
     // We pass MovieClip::MovieVariables() twice, as the second one is
     // for scriptable Variables, which isn't fully implemented yet.
diff --git a/utilities/processor.cpp b/utilities/processor.cpp
index 6af868b..14304f1 100644
--- a/utilities/processor.cpp
+++ b/utilities/processor.cpp
@@ -225,9 +225,6 @@ main(int argc, char *argv[])
 {
     std::ios::sync_with_stdio(false);
 
-    /// Initialize gnash core library
-    gnashInit();
-
     // Enable native language support, i.e. internationalization
 #ifdef ENABLE_NLS
     std::setlocale (LC_ALL, "");

http://git.savannah.gnu.org/cgit//commit/?id=415921adbcaae6a4c5b52b57036f91d035347128


commit 415921adbcaae6a4c5b52b57036f91d035347128
Author: Benjamin Wolsey <address@hidden>
Date:   Fri Oct 8 14:26:48 2010 +0200

    Reduce places URL is stored.

diff --git a/gui/Player.cpp b/gui/Player.cpp
index 2f32016..4654e83 100644
--- a/gui/Player.cpp
+++ b/gui/Player.cpp
@@ -318,7 +318,7 @@ Player::run(int argc, char* argv[], const std::string& 
infile,
     const URL baseURL = (it == _params.end()) ? _baseurl :
                                                URL(it->second, _baseurl);
     /// The RunResources should be populated before parsing.
-    _runResources.reset(new RunResources(baseURL.str()));
+    _runResources.reset(new RunResources());
 
     boost::shared_ptr<SWF::TagLoadersTable> loaders(new 
SWF::TagLoadersTable());
     addDefaultLoaders(*loaders);
@@ -327,7 +327,7 @@ Player::run(int argc, char* argv[], const std::string& 
infile,
     std::auto_ptr<NamingPolicy> np(new IncrementalRename(_baseurl));
 
     /// The StreamProvider uses the actual URL of the loaded movie.
-    boost::shared_ptr<StreamProvider> sp(new StreamProvider(_url, np));
+    boost::shared_ptr<StreamProvider> sp(new StreamProvider(baseURL, np));
 
     _runResources->setStreamProvider(sp);
 
@@ -535,7 +535,7 @@ Player::run(int argc, char* argv[], const std::string& 
infile,
 
         // Use default if filename is empty.
         if (_screenshotFile.empty()) {
-            URL url(_runResources->baseURL());
+            URL url(_runResources->streamProvider().originalURL());
             std::string::size_type p = url.path().rfind('/');
             const std::string& name = (p == std::string::npos) ? url.path() :
                 url.path().substr(p + 1);
diff --git a/gui/gui.cpp b/gui/gui.cpp
index 08119be..4f942c3 100644
--- a/gui/gui.cpp
+++ b/gui/gui.cpp
@@ -22,8 +22,16 @@
 #include "gnashconfig.h"
 #endif
 
-#include "MovieClip.h"
 #include "gui.h"
+
+#include <vector>
+#include <cstdio>
+#include <cstring>
+#include <algorithm> 
+#include <boost/algorithm/string/replace.hpp>
+#include <boost/lexical_cast.hpp>
+
+#include "MovieClip.h"
 #include "Renderer.h"
 #include "sound_handler.h"
 #include "movie_root.h"
@@ -32,19 +40,13 @@
 #include "tu_file.h"
 #include "gnash.h"
 #include "RunResources.h"
+#include "StreamProvider.h"
 
 #ifdef GNASH_FPS_DEBUG
 #include "ClockTime.h"
 #include <boost/format.hpp>
 #endif
 
-#include <vector>
-#include <cstdio>
-#include <cstring>
-#include <algorithm> 
-#include <boost/algorithm/string/replace.hpp>
-#include <boost/lexical_cast.hpp>
-
 /// Define this to make sure each frame is fully rendered from ground up
 /// even if no motion has been detected in the movie.
 //#define FORCE_REDRAW 1
@@ -1026,7 +1028,7 @@ Gui::takeScreenShot()
     if (!_screenShotter.get()) {
         // If no ScreenShotter exists, none was requested at startup.
         // We use a default filename pattern.
-        URL url(_runResources.baseURL());
+        URL url(_runResources.streamProvider().originalURL());
         std::string::size_type p = url.path().rfind('/');
         const std::string& name = (p == std::string::npos) ? url.path() :
             url.path().substr(p + 1);
diff --git a/gui/pythonmod/gnash-view.cpp b/gui/pythonmod/gnash-view.cpp
index a831f39..74a6b9e 100644
--- a/gui/pythonmod/gnash-view.cpp
+++ b/gui/pythonmod/gnash-view.cpp
@@ -423,12 +423,12 @@ gnash_view_load_movie(GnashView *view, const gchar *uri)
     gnash::URL url(uri);
 
     // The RunResources should be populated before parsing.
-    view->run_info.reset(new gnash::RunResources(url.str()));
+    view->run_info.reset(new gnash::RunResources());
     view->run_info->setSoundHandler(view->sound_handler);
 
     std::auto_ptr<gnash::NamingPolicy> np(new gnash::IncrementalRename(url));
     boost::shared_ptr<gnash::StreamProvider> sp(
-           new gnash::StreamProvider(uri, np));
+           new gnash::StreamProvider(url, np));
     view->run_info->setStreamProvider(sp);
 
     gnash::RcInitFile& rcfile = gnash::RcInitFile::getDefaultInstance();
diff --git a/libcore/MovieClip.cpp b/libcore/MovieClip.cpp
index f52ad14..a2beec8 100644
--- a/libcore/MovieClip.cpp
+++ b/libcore/MovieClip.cpp
@@ -1895,12 +1895,14 @@ MovieClip::loadVariables(const std::string& urlstr,
     // (down by getStream, that is)
     
     const movie_root& mr = stage();
-    URL url(urlstr, mr.runResources().baseURL());
+    URL url(urlstr, mr.runResources().streamProvider().originalURL());
 
     std::string postdata;
     
     // Encode our vars for sending.
-    if (sendVarsMethod != METHOD_NONE) getURLEncodedVars(*getObject(this), 
postdata);
+    if (sendVarsMethod != METHOD_NONE) {
+        getURLEncodedVars(*getObject(this), postdata);
+    }
 
     try 
     {
diff --git a/libcore/MovieLoader.cpp b/libcore/MovieLoader.cpp
index 6eb637d..0e58097 100644
--- a/libcore/MovieLoader.cpp
+++ b/libcore/MovieLoader.cpp
@@ -31,6 +31,7 @@
 #include "namedStrings.h"
 #include "ExecutableCode.h"
 #include "RunResources.h"
+#include "StreamProvider.h"
 
 #include <memory> // for auto_ptr
 #include <boost/bind.hpp>
@@ -433,7 +434,7 @@ MovieLoader::loadMovie(const std::string& urlstr,
 
     /// URL security is checked in StreamProvider::getStream() down the
     /// chain.
-    URL url(urlstr, _movieRoot.runResources().baseURL());
+    URL url(urlstr, _movieRoot.runResources().streamProvider().originalURL());
 
     /// If the method is MovieClip::METHOD_NONE, we send no data.
     if (method == MovieClip::METHOD_GET)
diff --git a/libcore/RunResources.h b/libcore/RunResources.h
index 863561b..206827f 100644
--- a/libcore/RunResources.h
+++ b/libcore/RunResources.h
@@ -56,15 +56,7 @@ public:
     //
     /// @param baseURL  The base URL for the run. This cannot be changed after
     ///                 construction.
-    RunResources(const std::string& baseURL)
-        :
-        _baseURL(baseURL)
-    {}
-
-    /// Get the base URL for the run.
-    //
-    /// @return     The base URL set at construction.
-    const std::string& baseURL() const { return _baseURL; }
+    RunResources() {}
 
     /// Set the StreamProvider.
     //
@@ -150,8 +142,6 @@ public:
 
 private:
 
-    const std::string _baseURL;
-
     boost::shared_ptr<StreamProvider> _streamProvider;
 
     boost::shared_ptr<sound::sound_handler> _soundHandler;
diff --git a/libcore/StreamProvider.cpp b/libcore/StreamProvider.cpp
index 746bb42..53203fc 100644
--- a/libcore/StreamProvider.cpp
+++ b/libcore/StreamProvider.cpp
@@ -36,8 +36,7 @@
 
 namespace gnash {
 
-StreamProvider::StreamProvider(const std::string& url,
-        std::auto_ptr<NamingPolicy> np)
+StreamProvider::StreamProvider(const URL& url, std::auto_ptr<NamingPolicy> np)
     :
     _namingPolicy(np),
     _url(url)
@@ -50,8 +49,6 @@ StreamProvider::allow(const URL& url) const
     return URLAccessManager::allow(url, _url);
 }
 
-
-
 std::auto_ptr<IOChannel>
 StreamProvider::getStream(const URL& url, bool namedCacheFile) const
 {
diff --git a/libcore/StreamProvider.h b/libcore/StreamProvider.h
index 093db41..5fdbca3 100644
--- a/libcore/StreamProvider.h
+++ b/libcore/StreamProvider.h
@@ -41,7 +41,7 @@ class DSOEXPORT StreamProvider
 
 public:
 
-       StreamProvider(const std::string& url, std::auto_ptr<NamingPolicy> = 
+       StreamProvider(const URL& url, std::auto_ptr<NamingPolicy> = 
             std::auto_ptr<NamingPolicy>(new NamingPolicy));
 
        virtual ~StreamProvider() {}
@@ -90,9 +90,13 @@ public:
         return *_namingPolicy;
     }
 
+    /// Whether to allow access to a certain URL.
     bool allow(const URL& url) const;
 
-    const URL& url() const {
+    /// The genuine original URL used for loading the first SWF.
+    //
+    /// This is used to manage access to later URLs.
+    const URL& originalURL() const {
         return _url;
     }
 
diff --git a/libcore/asobj/LoadableObject.cpp b/libcore/asobj/LoadableObject.cpp
index 6ad2a5a..60fb7ea 100644
--- a/libcore/asobj/LoadableObject.cpp
+++ b/libcore/asobj/LoadableObject.cpp
@@ -344,7 +344,7 @@ loadableobject_sendAndLoad(const fn_call& fn)
 
     const RunResources& ri = getRunResources(*obj);
 
-    URL url(urlstr, ri.baseURL());
+    URL url(urlstr, ri.streamProvider().originalURL());
 
     std::auto_ptr<IOChannel> str;
 
@@ -437,13 +437,12 @@ loadableobject_load(const fn_call& fn)
     obj->set_member(NSV::PROP_LOADED, false);
 
     const RunResources& ri = getRunResources(*obj);
-    URL url(urlstr, ri.baseURL());
+
+    URL url(urlstr, ri.streamProvider().originalURL());
 
     // Checks whether access is allowed.
     std::auto_ptr<IOChannel> str(ri.streamProvider().getStream(url));
 
-    log_security(_("Loading from url: '%s'"), url.str());
-    
     movie_root& mr = getRoot(fn);
     mr.addLoadableObject(obj, str);
 
diff --git a/libcore/asobj/LocalConnection_as.cpp 
b/libcore/asobj/LocalConnection_as.cpp
index 5885624..f901359 100644
--- a/libcore/asobj/LocalConnection_as.cpp
+++ b/libcore/asobj/LocalConnection_as.cpp
@@ -937,7 +937,7 @@ std::string
 getDomain(as_object& o)
 {
     
-    const URL& url = getRunResources(o).streamProvider().url();
+    const URL& url = getRunResources(o).streamProvider().originalURL();
 
     if (url.hostname().empty()) {
         return "localhost";
diff --git a/libcore/asobj/NetConnection_as.cpp 
b/libcore/asobj/NetConnection_as.cpp
index fe19843..0820fcf 100644
--- a/libcore/asobj/NetConnection_as.cpp
+++ b/libcore/asobj/NetConnection_as.cpp
@@ -712,7 +712,7 @@ NetConnection_as::validateURL() const
 {
 
     const RunResources& r = getRunResources(owner());
-    URL uri(_uri, r.baseURL());
+    URL uri(_uri, r.streamProvider().originalURL());
 
     std::string uriStr(uri.str());
     assert(uriStr.find("://") != std::string::npos);
@@ -818,7 +818,7 @@ NetConnection_as::connect(const std::string& uri)
     }
     
     const RunResources& r = getRunResources(owner());
-    URL url(_uri, r.baseURL());
+    URL url(_uri, r.streamProvider().originalURL());
 
     if ((url.protocol() != "rtmp")
         && (url.protocol() != "rtmpt")
@@ -925,10 +925,10 @@ NetConnection_as::getStream(const std::string& name)
     // If name is a full or relative URL passed from NetStream.play(), it
     // must be constructed against the base URL, not the NetConnection uri,
     // which should always be null in this case.
-    const URL url(name, ri.baseURL());
-
     const RcInitFile& rcfile = RcInitFile::getDefaultInstance();
 
+    URL url(name, streamProvider.originalURL());
+
     return streamProvider.getStream(url, rcfile.saveStreamingMedia());
 
 }
diff --git a/libcore/asobj/SharedObject_as.cpp 
b/libcore/asobj/SharedObject_as.cpp
index bbb083c..2521c9e 100644
--- a/libcore/asobj/SharedObject_as.cpp
+++ b/libcore/asobj/SharedObject_as.cpp
@@ -424,7 +424,7 @@ SharedObjectLibrary::SharedObjectLibrary(VM& vm)
     // by the 'base' attribute of OBJECT or EMBED tags trough
     // -P base=xxx
     const movie_root& mr = _vm.getRoot();
-    const URL& url = mr.runResources().streamProvider().url();
+    const URL& url = mr.runResources().streamProvider().originalURL();
 
     // Remember the hostname of our SWF URL. This can be empty if loaded
     // from the filesystem
@@ -506,7 +506,7 @@ SharedObjectLibrary::getLocal(const std::string& objName,
 
         const movie_root& mr = _vm.getRoot();
 
-        const URL& swfURL = mr.runResources().streamProvider().url();
+        const URL& swfURL = mr.runResources().streamProvider().originalURL();
         // The specified root may or may not have a domain. If it doesn't,
         // this constructor will add the SWF's domain.
         URL localPath(root, swfURL);
diff --git a/libcore/asobj/Sound_as.cpp b/libcore/asobj/Sound_as.cpp
index 6b4f690..44b3ee4 100644
--- a/libcore/asobj/Sound_as.cpp
+++ b/libcore/asobj/Sound_as.cpp
@@ -531,7 +531,7 @@ Sound_as::loadSound(const std::string& file, bool streaming)
     _startTime=0;
 
     const RunResources& rr = getRunResources(owner());
-    URL url(file, rr.baseURL());
+    URL url(file, rr.streamProvider().originalURL());
 
     const RcInitFile& rcfile = RcInitFile::getDefaultInstance();
 
diff --git a/libcore/asobj/flash/external/ExternalInterface_as.cpp 
b/libcore/asobj/flash/external/ExternalInterface_as.cpp
index 6d50cba..f3a693c 100644
--- a/libcore/asobj/flash/external/ExternalInterface_as.cpp
+++ b/libcore/asobj/flash/external/ExternalInterface_as.cpp
@@ -316,7 +316,7 @@ externalinterface_available(const fn_call& fn)
       case movie_root::SCRIPT_ACCESS_SAME_DOMAIN:
       {
           const RunResources& r = m.runResources();
-          const std::string& baseurl = r.baseURL();
+          const std::string& baseurl = r.streamProvider().originalURL().str();
           char hostname[MAXHOSTNAMELEN];
           std::memset(hostname, 0, MAXHOSTNAMELEN);
           
diff --git a/libcore/movie_root.cpp b/libcore/movie_root.cpp
index fee8762..dd91ce3 100644
--- a/libcore/movie_root.cpp
+++ b/libcore/movie_root.cpp
@@ -18,9 +18,22 @@
 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 // 
 
-#include "GnashSystemIOHeaders.h" // write()
-
 #include "movie_root.h"
+
+#include <boost/algorithm/string/erase.hpp>
+#include <boost/algorithm/string/replace.hpp>
+#include <utility>
+#include <iostream>
+#include <string>
+#include <sstream>
+#include <map>
+#include <bitset>
+#include <cassert>
+#include <functional>
+#include <boost/algorithm/string/case_conv.hpp>
+#include <boost/bind.hpp>
+
+#include "GnashSystemIOHeaders.h" // write()
 #include "log.h"
 #include "MovieClip.h"
 #include "Movie.h" // for implicit upcast to MovieClip
@@ -44,19 +57,7 @@
 #include "TextField.h"
 #include "Button.h"
 #include "Transform.h"
-
-#include <boost/algorithm/string/erase.hpp>
-#include <boost/algorithm/string/replace.hpp>
-#include <utility>
-#include <iostream>
-#include <string>
-#include <sstream>
-#include <map>
-#include <bitset>
-#include <cassert>
-#include <functional>
-#include <boost/algorithm/string/case_conv.hpp>
-#include <boost/bind.hpp>
+#include "StreamProvider.h"
 
 #ifdef USE_SWFTREE
 # include "tree.hh"
@@ -2127,7 +2128,7 @@ movie_root::getURL(const std::string& urlstr, const 
std::string& target,
         /// If there is no hosting application, call the URL launcher. For
         /// safety, we resolve the URL against the base URL for this run.
         /// The data is not sent at all.
-        URL url(urlstr, _runResources.baseURL());
+        URL url(urlstr, _runResources.streamProvider().originalURL());
 
         gnash::RcInitFile& rcfile = gnash::RcInitFile::getDefaultInstance();
         std::string command = rcfile.getURLOpenerFormat();
diff --git a/libcore/swf/ImportAssetsTag.h b/libcore/swf/ImportAssetsTag.h
index b2f2505..10634b6 100644
--- a/libcore/swf/ImportAssetsTag.h
+++ b/libcore/swf/ImportAssetsTag.h
@@ -30,6 +30,7 @@
 #include "SWFStream.h"
 #include "MovieFactory.h"
 #include "log.h"
+#include "StreamProvider.h"
 
 namespace gnash {
 namespace SWF {
@@ -79,7 +80,7 @@ private:
         in.read_string(source_url);
 
         // Resolve relative urls against baseurl
-        URL abs_url(source_url, r.baseURL());
+        URL abs_url(source_url, r.streamProvider().originalURL());
 
         unsigned char import_version = 0;
 
diff --git a/testsuite/MovieTester.cpp b/testsuite/MovieTester.cpp
index a1cafe2..3953c87 100644
--- a/testsuite/MovieTester.cpp
+++ b/testsuite/MovieTester.cpp
@@ -84,7 +84,7 @@ MovieTester::MovieTester(const std::string& url)
     // Initialize the sound handler(s)
     initTestingSoundHandlers();
     
-    _runResources.reset(new RunResources(url));
+    _runResources.reset(new RunResources());
     _runResources->setSoundHandler(_sound_handler);
     _runResources->setMediaHandler(_mediaHandler);
     
diff --git a/testsuite/libcore.all/AsValueTest.cpp 
b/testsuite/libcore.all/AsValueTest.cpp
index e1e5ed1..b6f41cc 100644
--- a/testsuite/libcore.all/AsValueTest.cpp
+++ b/testsuite/libcore.all/AsValueTest.cpp
@@ -27,6 +27,7 @@
 #include "movie_definition.h"
 #include "dejagnu.h"
 #include "as_value.h"
+#include "StreamProvider.h"
 #include "as_object.h"
 #include "arg_parser.h"
 #include "Global_as.h"
@@ -112,7 +113,9 @@ main(int argc, char *argv[])
     // Initialize gnash lib
     gnashInit();
     
-    RunResources runResources("");
+    RunResources runResources;
+    runResources.setStreamProvider(
+            boost::shared_ptr<StreamProvider>(new StreamProvider(URL(""))));
 
     // Create a bogus movie with swf version 7 support
     movie_definition* md = new DummyMovieDefinition(runResources, 7);
diff --git a/testsuite/libcore.all/DisplayListTest.cpp 
b/testsuite/libcore.all/DisplayListTest.cpp
index 7d673fd..eb8d9a3 100644
--- a/testsuite/libcore.all/DisplayListTest.cpp
+++ b/testsuite/libcore.all/DisplayListTest.cpp
@@ -30,6 +30,7 @@
 #include "movie_definition.h"
 #include "ManualClock.h"
 #include "RunResources.h"
+#include "StreamProvider.h"
 
 #include <iostream>
 #include <sstream>
@@ -50,7 +51,9 @@ main(int /*argc*/, char** /*argv*/)
     // Initialize gnash lib
     gnashInit();
     
-    RunResources ri("");
+    RunResources ri;
+    ri.setStreamProvider(
+            boost::shared_ptr<StreamProvider>(new StreamProvider(URL("")));
     
     // Initialize a VM
     boost::intrusive_ptr<movie_definition> md5(new DummyMovieDefinition(ri, 
5));
diff --git a/testsuite/libcore.all/PropertyListTest.cpp 
b/testsuite/libcore.all/PropertyListTest.cpp
index cbedd10..71ab3c0 100644
--- a/testsuite/libcore.all/PropertyListTest.cpp
+++ b/testsuite/libcore.all/PropertyListTest.cpp
@@ -31,6 +31,7 @@
 #include "PropFlags.h"
 #include "ManualClock.h"
 #include "RunResources.h"
+#include "StreamProvider.h"
 
 #include <iostream>
 #include <sstream>
@@ -68,7 +69,9 @@ main(int /*argc*/, char** /*argv*/)
        gnashInit();
 
     // We don't care about the base URL.
-    RunResources runResources("");
+    RunResources runResources;
+    runResources.setStreamProvider(
+            boost::shared_ptr<StreamProvider>(new StreamProvider(URL(""))));
        
     boost::intrusive_ptr<movie_definition> md5(
             new DummyMovieDefinition(runResources, 5));
diff --git a/utilities/processor.cpp b/utilities/processor.cpp
index eeacaf1..6af868b 100644
--- a/utilities/processor.cpp
+++ b/utilities/processor.cpp
@@ -383,7 +383,7 @@ main(int argc, char *argv[])
             e = infiles.end(); i != e; ++i)
     {
 
-        RunResources runResources(*i);
+        RunResources runResources;
         runResources.setSoundHandler(soundHandler);
         runResources.setMediaHandler(mediaHandler);
         runResources.setTagLoaders(loaders);

http://git.savannah.gnu.org/cgit//commit/?id=21f912f53c9e490ba8de5d3ade5addb45d7cc8a7


commit 21f912f53c9e490ba8de5d3ade5addb45d7cc8a7
Author: Benjamin Wolsey <address@hidden>
Date:   Fri Oct 8 13:02:27 2010 +0200

    Drop URLAccessManager VM::get.

diff --git a/gui/Player.cpp b/gui/Player.cpp
index c34043f..2f32016 100644
--- a/gui/Player.cpp
+++ b/gui/Player.cpp
@@ -325,7 +325,9 @@ Player::run(int argc, char* argv[], const std::string& 
infile,
     _runResources->setTagLoaders(loaders);
 
     std::auto_ptr<NamingPolicy> np(new IncrementalRename(_baseurl));
-    boost::shared_ptr<StreamProvider> sp(new StreamProvider(np));
+
+    /// The StreamProvider uses the actual URL of the loaded movie.
+    boost::shared_ptr<StreamProvider> sp(new StreamProvider(_url, np));
 
     _runResources->setStreamProvider(sp);
 
diff --git a/gui/pythonmod/gnash-view.cpp b/gui/pythonmod/gnash-view.cpp
index b93e7e3..a831f39 100644
--- a/gui/pythonmod/gnash-view.cpp
+++ b/gui/pythonmod/gnash-view.cpp
@@ -427,7 +427,8 @@ gnash_view_load_movie(GnashView *view, const gchar *uri)
     view->run_info->setSoundHandler(view->sound_handler);
 
     std::auto_ptr<gnash::NamingPolicy> np(new gnash::IncrementalRename(url));
-    boost::shared_ptr<gnash::StreamProvider> sp(new gnash::StreamProvider(np));
+    boost::shared_ptr<gnash::StreamProvider> sp(
+           new gnash::StreamProvider(uri, np));
     view->run_info->setStreamProvider(sp);
 
     gnash::RcInitFile& rcfile = gnash::RcInitFile::getDefaultInstance();
diff --git a/libcore/StreamProvider.cpp b/libcore/StreamProvider.cpp
index d31d988..746bb42 100644
--- a/libcore/StreamProvider.cpp
+++ b/libcore/StreamProvider.cpp
@@ -36,11 +36,20 @@
 
 namespace gnash {
 
-StreamProvider::StreamProvider(std::auto_ptr<NamingPolicy> np)
+StreamProvider::StreamProvider(const std::string& url,
+        std::auto_ptr<NamingPolicy> np)
     :
-    _namingPolicy(np)
+    _namingPolicy(np),
+    _url(url)
 {
 }
+    
+bool
+StreamProvider::allow(const URL& url) const
+{
+    return URLAccessManager::allow(url, _url);
+}
+
 
 
 std::auto_ptr<IOChannel>
@@ -69,7 +78,7 @@ StreamProvider::getStream(const URL& url, bool 
namedCacheFile) const
                else
                {
             // check security here !!
-                   if (!URLAccessManager::allow(url)) return stream;
+                   if (!allow(url)) return stream;
 
                        FILE *newin = std::fopen(path.c_str(), "rb");
                        if (!newin)  { 
@@ -82,7 +91,7 @@ StreamProvider::getStream(const URL& url, bool 
namedCacheFile) const
        }
        else
        {
-               if (URLAccessManager::allow(url)) {
+               if (allow(url)) {
                        stream = NetworkAdapter::makeStream(url.str(), 
                     namedCacheFile ? namingPolicy()(url) : "");
                }
@@ -108,7 +117,7 @@ StreamProvider::getStream(const URL& url, const 
std::string& postdata,
         return getStream(url, postdata);
     }
 
-       if ( URLAccessManager::allow(url) ) {
+       if (allow(url) ) {
                return NetworkAdapter::makeStream(url.str(), postdata, headers,
                     namedCacheFile ? namingPolicy()(url) : "");
        }
@@ -140,7 +149,7 @@ StreamProvider::getStream(const URL& url, const 
std::string& postdata,
                }
                else
                {
-                       if ( ! URLAccessManager::allow(url) ) return stream;
+                       if (!allow(url)) return stream;
 
                        FILE *newin = std::fopen(path.c_str(), "rb");
                        if (!newin)  { 
@@ -152,7 +161,7 @@ StreamProvider::getStream(const URL& url, const 
std::string& postdata,
        }
        else
        {
-               if (URLAccessManager::allow(url)) {
+               if (allow(url)) {
                        stream = NetworkAdapter::makeStream(url.str(), postdata,
                     namedCacheFile ? namingPolicy()(url) : "");
                }
diff --git a/libcore/StreamProvider.h b/libcore/StreamProvider.h
index ecedf5d..093db41 100644
--- a/libcore/StreamProvider.h
+++ b/libcore/StreamProvider.h
@@ -41,7 +41,7 @@ class DSOEXPORT StreamProvider
 
 public:
 
-       StreamProvider(std::auto_ptr<NamingPolicy> = 
+       StreamProvider(const std::string& url, std::auto_ptr<NamingPolicy> = 
             std::auto_ptr<NamingPolicy>(new NamingPolicy));
 
        virtual ~StreamProvider() {}
@@ -80,23 +80,29 @@ public:
     //
     /// This is only used when cache file naming is requested in getStream()
     /// This StreamProvider owns the NamingPolicy instance.
-    void setNamingPolicy(std::auto_ptr<NamingPolicy> np)
-    {
+    void setNamingPolicy(std::auto_ptr<NamingPolicy> np) {
         _namingPolicy = np;
     }
 
     /// Return the currently selected policy for converting URL to filename
-    const NamingPolicy& namingPolicy() const
-    {
+    const NamingPolicy& namingPolicy() const {
         assert(_namingPolicy.get());
         return *_namingPolicy;
     }
 
+    bool allow(const URL& url) const;
+
+    const URL& url() const {
+        return _url;
+    }
+
 private:
 
     /// The current naming policy for cache files.
     std::auto_ptr<NamingPolicy> _namingPolicy;
 
+    const URL _url;
+
 };
 
 } // namespace gnash
diff --git a/libcore/URLAccessManager.cpp b/libcore/URLAccessManager.cpp
index 154fcf3..13613da 100644
--- a/libcore/URLAccessManager.cpp
+++ b/libcore/URLAccessManager.cpp
@@ -139,7 +139,7 @@ pathIsUnderDir(const std::string& path, const std::string& 
dir)
 /// Return true if we allow load of the local resource, false otherwise.
 //
 static bool
-local_check(const std::string& path)
+local_check(const std::string& path, const URL& baseUrl)
 {
 //    GNASH_REPORT_FUNCTION;
 
@@ -148,9 +148,7 @@ local_check(const std::string& path)
     // Don't allow local access if starting movie is a network resource.
     if ( VM::isInitialized() )
     {
-       URL baseUrl(VM::get().getRoot().getOriginalURL());
-       if ( baseUrl.protocol() != "file" )
-       {
+       if (baseUrl.protocol() != "file") {
           log_security(_("Load of file %s forbidden"
               " (starting url %s is not a local resource)"),
               path, baseUrl.str());
@@ -275,7 +273,7 @@ allowXMLSocket(const std::string& host, short port)
 
 
 bool
-allow(const URL& url)
+allow(const URL& url, const URL& baseurl)
 {
        log_security(_("Checking security of URL '%s'"), url);
 
@@ -292,7 +290,7 @@ allow(const URL& url)
             log_error(_("Network connection without hostname requested"));
             return false;
         }
-               return local_check(url.path());
+               return local_check(url.path(), baseurl);
        }
        return host_check(host);
 }
diff --git a/libcore/URLAccessManager.h b/libcore/URLAccessManager.h
index 2e82562..ddd891d 100644
--- a/libcore/URLAccessManager.h
+++ b/libcore/URLAccessManager.h
@@ -36,7 +36,7 @@ namespace URLAccessManager {
 //
 /// Will use rc file for whitelist/blacklist and localSendbox.
 ///
-bool allow(const URL& url);
+bool allow(const URL& url, const URL& baseurl);
 
 //bool allowHost(const std::string& str);
 
diff --git a/libcore/asobj/LocalConnection_as.cpp 
b/libcore/asobj/LocalConnection_as.cpp
index 521fcb8..5885624 100644
--- a/libcore/asobj/LocalConnection_as.cpp
+++ b/libcore/asobj/LocalConnection_as.cpp
@@ -17,14 +17,21 @@
 // along with this program; if not, write to the Free Software
 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 
+#include "LocalConnection_as.h"
+
+#include <boost/shared_ptr.hpp>
+#include <cerrno>
+#include <cstring>
+#include <boost/cstdint.hpp> // for boost::?int??_t
+#include <boost/assign/list_of.hpp>
+#include <boost/bind.hpp>
+
 #include "GnashSystemIOHeaders.h"
 
 #include "VM.h"
 #include "movie_root.h"
-#include "URLAccessManager.h"
 #include "URL.h"
 #include "log.h"
-#include "LocalConnection_as.h"
 #include "fn_call.h"
 #include "Global_as.h"
 #include "builtin_function.h"
@@ -36,13 +43,9 @@
 #include "AMFConverter.h"
 #include "ClockTime.h"
 #include "GnashAlgorithm.h"
+#include "RunResources.h"
+#include "StreamProvider.h"
 
-#include <boost/shared_ptr.hpp>
-#include <cerrno>
-#include <cstring>
-#include <boost/cstdint.hpp> // for boost::?int??_t
-#include <boost/assign/list_of.hpp>
-#include <boost/bind.hpp>
 
 /// From observing the behaviour of the pp, the following seem to be true.
 //
@@ -934,7 +937,7 @@ std::string
 getDomain(as_object& o)
 {
     
-    URL url(getRoot(o).getOriginalURL());
+    const URL& url = getRunResources(o).streamProvider().url();
 
     if (url.hostname().empty()) {
         return "localhost";
diff --git a/libcore/asobj/NetConnection_as.cpp 
b/libcore/asobj/NetConnection_as.cpp
index 5159478..fe19843 100644
--- a/libcore/asobj/NetConnection_as.cpp
+++ b/libcore/asobj/NetConnection_as.cpp
@@ -30,7 +30,6 @@
 #include "builtin_function.h"
 #include "movie_root.h"
 #include "StreamProvider.h"
-#include "URLAccessManager.h"
 #include "URL.h"
 #include "VM.h"
 #include "SimpleBuffer.h"
@@ -712,13 +711,14 @@ std::string
 NetConnection_as::validateURL() const
 {
 
-    URL uri(_uri, getRunResources(owner()).baseURL());
+    const RunResources& r = getRunResources(owner());
+    URL uri(_uri, r.baseURL());
 
     std::string uriStr(uri.str());
     assert(uriStr.find("://") != std::string::npos);
 
     // Check if we're allowed to open url
-    if (!URLAccessManager::allow(uri)) {
+    if (!r.streamProvider().allow(uri)) {
         log_security(_("Gnash is not allowed to open this url: %s"), uriStr);
         return "";
     }
@@ -816,8 +816,9 @@ NetConnection_as::connect(const std::string& uri)
         notifyStatus(CONNECT_FAILED);
         return;
     }
-
-    URL url(uri, getRunResources(owner()).baseURL());
+    
+    const RunResources& r = getRunResources(owner());
+    URL url(_uri, r.baseURL());
 
     if ((url.protocol() != "rtmp")
         && (url.protocol() != "rtmpt")
@@ -835,7 +836,7 @@ NetConnection_as::connect(const std::string& uri)
     
     // This is for HTTP remoting
 
-    if (!URLAccessManager::allow(url)) {
+    if (!r.streamProvider().allow(url)) {
         log_security(_("Gnash is not allowed to NetConnection.connect "
                     "to %s"), url);
         notifyStatus(CONNECT_FAILED);
diff --git a/libcore/asobj/SharedObject_as.cpp 
b/libcore/asobj/SharedObject_as.cpp
index 2aa8e6d..bbb083c 100644
--- a/libcore/asobj/SharedObject_as.cpp
+++ b/libcore/asobj/SharedObject_as.cpp
@@ -22,13 +22,18 @@
 #include "gnashconfig.h" 
 #endif
 
+#include "SharedObject_as.h"
+
+#include <boost/scoped_array.hpp>
+#include <boost/shared_ptr.hpp>
+#include <cstdio>
+
 #include "smart_ptr.h" // GNASH_USE_GC
 #include "movie_root.h"
 #include "GnashSystemNetHeaders.h"
 #include "GnashFileUtilities.h" // stat
 #include "SimpleBuffer.h"
 #include "as_value.h"
-#include "SharedObject_as.h"
 #include "as_object.h" // for inheritance
 #include "log.h"
 #include "fn_call.h"
@@ -39,19 +44,15 @@
 #include "Property.h"
 #include "string_table.h"
 #include "rc.h" // for use of rcfile
-#include "URLAccessManager.h"
 #include "URL.h"
 #include "NetConnection_as.h"
 #include "Object.h"
 #include "AMFConverter.h"
 #include "GnashAlgorithm.h"
 #include "RunResources.h"
+#include "StreamProvider.h"
 #include "namedStrings.h"
 
-#include <boost/scoped_array.hpp>
-#include <boost/shared_ptr.hpp>
-#include <cstdio>
-
 namespace {
     gnash::RcInitFile& rcfile = gnash::RcInitFile::getDefaultInstance();
 }
@@ -423,9 +424,7 @@ SharedObjectLibrary::SharedObjectLibrary(VM& vm)
     // by the 'base' attribute of OBJECT or EMBED tags trough
     // -P base=xxx
     const movie_root& mr = _vm.getRoot();
-    const std::string& swfURL = mr.getOriginalURL();
-
-    URL url(swfURL);
+    const URL& url = mr.runResources().streamProvider().url();
 
     // Remember the hostname of our SWF URL. This can be empty if loaded
     // from the filesystem
@@ -506,7 +505,8 @@ SharedObjectLibrary::getLocal(const std::string& objName,
     if (!root.empty()) {
 
         const movie_root& mr = _vm.getRoot();
-        const std::string& swfURL = mr.getOriginalURL();
+
+        const URL& swfURL = mr.runResources().streamProvider().url();
         // The specified root may or may not have a domain. If it doesn't,
         // this constructor will add the SWF's domain.
         URL localPath(root, swfURL);
diff --git a/libcore/asobj/flash/external/ExternalInterface_as.cpp 
b/libcore/asobj/flash/external/ExternalInterface_as.cpp
index 127089a..6d50cba 100644
--- a/libcore/asobj/flash/external/ExternalInterface_as.cpp
+++ b/libcore/asobj/flash/external/ExternalInterface_as.cpp
@@ -36,7 +36,6 @@
 #include "smart_ptr.h" // for boost intrusive_ptr
 #include "builtin_function.h" // need builtin_function
 #include "GnashException.h" // for ActionException
-#include "URLAccessManager.h"
 #include "VM.h"
 #include "rc.h"
 #include "as_value.h"
@@ -48,6 +47,8 @@
 #include "PropertyList.h"
 #include "movie_root.h"
 #include "log.h"
+#include "RunResources.h"
+#include "StreamProvider.h"
 
 #define MAXHOSTNAMELEN 256 // max hostname size. However this is defined in 
netdb.h
 
@@ -314,9 +315,10 @@ externalinterface_available(const fn_call& fn)
           
       case movie_root::SCRIPT_ACCESS_SAME_DOMAIN:
       {
-          const std::string& baseurl = m.getOriginalURL();
+          const RunResources& r = m.runResources();
+          const std::string& baseurl = r.baseURL();
           char hostname[MAXHOSTNAMELEN];
-          memset(hostname, 0, MAXHOSTNAMELEN);
+          std::memset(hostname, 0, MAXHOSTNAMELEN);
           
           if (::gethostname(hostname, MAXHOSTNAMELEN) != 0) {
               mode = false;
@@ -326,7 +328,7 @@ externalinterface_available(const fn_call& fn)
           // a terminal, so we can assume the default of sameDomain applies.
           URL localPath(hostname, baseurl);
           // If the URL has a file protocol, then 
-          if (URLAccessManager::allow(localPath)) {
+          if (r.streamProvider().allow(localPath)) {
               return as_value(true);
           }
           if (localPath.hostname().empty()) {
diff --git a/libcore/movie_root.cpp b/libcore/movie_root.cpp
index 17c1dc7..fee8762 100644
--- a/libcore/movie_root.cpp
+++ b/libcore/movie_root.cpp
@@ -128,7 +128,6 @@ movie_root::movie_root(const movie_definition& def,
         VirtualClock& clock, const RunResources& runResources)
     :
     _runResources(runResources),
-    _originalURL(def.get_url()),
     _vm(VM::init(def.get_version(), *this, clock)),
     _interfaceHandler(0),
     _fsCommandHandler(0),
diff --git a/libcore/movie_root.h b/libcore/movie_root.h
index a3851b9..34da49f 100644
--- a/libcore/movie_root.h
+++ b/libcore/movie_root.h
@@ -866,12 +866,6 @@ public:
     void getCharacterTree(tree<StringPair>& tr, tree<StringPair>::iterator it);
 #endif
 
-    /// Get URL of the SWF movie used to initialize this VM
-    //
-    /// This information will be used for security checks
-    ///
-    const std::string& getOriginalURL() const { return _originalURL; }
-
     const RunResources& runResources() const { return _runResources; }
 
     void addExternalCallback(as_object *obj, const std::string &name,
@@ -930,12 +924,6 @@ private:
 
     const RunResources& _runResources; 
 
-    /// The URL of the original root movie.
-    //
-    /// This is a runtime constant because it must not change during a 
-    /// run.
-    const std::string _originalURL;
-
     /// This initializes a SharedObjectLibrary, which requires 
     /// _originalURL, so that must be initialized first.
     VM& _vm;
diff --git a/testsuite/MovieTester.cpp b/testsuite/MovieTester.cpp
index 47fb718..a1cafe2 100644
--- a/testsuite/MovieTester.cpp
+++ b/testsuite/MovieTester.cpp
@@ -93,8 +93,9 @@ MovieTester::MovieTester(const std::string& url)
     
     _runResources->setTagLoaders(loaders);
     
-    _runResources->setStreamProvider(boost::shared_ptr<StreamProvider>(
-                                                      new StreamProvider));
+    boost::shared_ptr<StreamProvider> sp(new StreamProvider(url));
+
+    _runResources->setStreamProvider(sp);
 
     if ( url == "-" ) {
        std::auto_ptr<IOChannel> in (
diff --git a/utilities/processor.cpp b/utilities/processor.cpp
index c7b85c5..eeacaf1 100644
--- a/utilities/processor.cpp
+++ b/utilities/processor.cpp
@@ -116,8 +116,8 @@ gnash::Debugger& debugger = 
gnash::Debugger::getDefaultInstance();
 #endif
 }
 
-static bool play_movie(
-        const std::string& filename, const RunResources& runResources);
+static bool play_movie(const std::string& filename,
+        const RunResources& runResources);
 
 static bool s_stop_on_errors = true;
 
@@ -362,7 +362,6 @@ main(int argc, char *argv[])
     mediaHandler.reset(media::MediaFactory::instance().get(mh));
     soundHandler.reset(new sound::NullSoundHandler(mediaHandler.get()));
 
-    boost::shared_ptr<StreamProvider> sp(new StreamProvider);
 
 
     boost::shared_ptr<SWF::TagLoadersTable> loaders(new 
SWF::TagLoadersTable());
@@ -375,7 +374,7 @@ main(int argc, char *argv[])
     // evidently accessed after main() returns. Rather than bothering to
     // work out why, we let this byte leak, as it's returned to the system on
     // exit anyway.
-    unsigned char* buf = new unsigned char[1];
+    unsigned char* buf = new unsigned char[8];
     r->init_buffer(buf, 1, 1, 1, 1);
 #endif
 
@@ -387,8 +386,10 @@ main(int argc, char *argv[])
         RunResources runResources(*i);
         runResources.setSoundHandler(soundHandler);
         runResources.setMediaHandler(mediaHandler);
-        runResources.setStreamProvider(sp);
         runResources.setTagLoaders(loaders);
+        boost::shared_ptr<StreamProvider> sp(new StreamProvider(*i));
+        runResources.setStreamProvider(sp);
+
 #ifdef RENDERER_AGG
         runResources.setRenderer(r);
 #endif
@@ -419,7 +420,7 @@ play_movie(const std::string& filename, const RunResources& 
runResources)
     quitrequested = false;
 
     URL url(filename);
-
+    
     try
     {
       if (filename == "-")
@@ -455,7 +456,7 @@ play_movie(const std::string& filename, const RunResources& 
runResources)
         std::cerr << "error: can't play movie: "<< filename << std::endl;
            return false;
     }
-
+    
     float fps = md->get_frame_rate();
     long fpsDelay = long(1000000/fps);
     long clockAdvance = fpsDelay/1000;

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

Summary of changes:
 cygnal/cvm.cpp                                     |    3 -
 gui/Player.cpp                                     |   17 +--
 gui/gtk/gtk.cpp                                    |    2 +-
 gui/gtk/gtk_canvas.cpp                             |    4 +-
 gui/gtk/gtk_canvas.h                               |    3 +-
 gui/gtk/gtk_glue.h                                 |   10 +-
 gui/gtk/gtk_glue_agg.cpp                           |    2 +-
 gui/gtk/gtk_glue_agg.h                             |    2 +-
 gui/gtk/gtk_glue_agg_vaapi.cpp                     |    7 +-
 gui/gtk/gtk_glue_agg_vaapi.h                       |    3 +-
 gui/gtk/gtk_glue_agg_xv.cpp                        |   10 +-
 gui/gtk/gtk_glue_agg_xv.h                          |    4 +-
 gui/gui.cpp                                        |   37 ++---
 gui/gui.h                                          |    2 +-
 gui/pythonmod/gnash-view.cpp                       |    9 +-
 libbase/GC.cpp                                     |   41 ++---
 libbase/GC.h                                       |  155 +++++++-------------
 libcore/DisplayObject.cpp                          |    1 +
 libcore/FreetypeGlyphsProvider.cpp                 |    3 +
 libcore/MovieClip.cpp                              |    6 +-
 libcore/MovieLoader.cpp                            |    3 +-
 libcore/Relay.cpp                                  |    1 -
 libcore/RunResources.h                             |   12 +--
 libcore/StreamProvider.cpp                         |   22 ++-
 libcore/StreamProvider.h                           |   20 ++-
 libcore/URLAccessManager.cpp                       |   25 +--
 libcore/URLAccessManager.h                         |    2 +-
 libcore/as_object.cpp                              |    2 +
 libcore/asobj/LoadableObject.cpp                   |    7 +-
 libcore/asobj/LocalConnection_as.cpp               |   25 ++--
 libcore/asobj/NetConnection_as.cpp                 |   17 +-
 libcore/asobj/NetStream_as.cpp                     |    4 +-
 libcore/asobj/SharedObject_as.cpp                  |   20 ++--
 libcore/asobj/Sound_as.cpp                         |    5 +-
 libcore/asobj/XMLSocket_as.cpp                     |    2 -
 .../asobj/flash/external/ExternalInterface_as.cpp  |   10 +-
 libcore/gnash.h                                    |    5 -
 libcore/impl.cpp                                   |   35 +-----
 libcore/movie_root.cpp                             |   43 +++---
 libcore/movie_root.h                               |   45 +++---
 libcore/swf/ImportAssetsTag.h                      |    3 +-
 libcore/vm/VM.cpp                                  |  105 +++-----------
 libcore/vm/VM.h                                    |  139 ++++++++----------
 plugin/win32/plugin.cpp                            |    1 -
 testsuite/MovieTester.cpp                          |   10 +-
 testsuite/MovieTester.h                            |    5 +
 testsuite/libcore.all/AsValueTest.cpp              |    6 +-
 testsuite/libcore.all/DisplayListTest.cpp          |    6 +-
 testsuite/libcore.all/PropertyListTest.cpp         |   28 ++--
 testsuite/misc-ming.all/DefineTextTest-Runner.cpp  |    3 +-
 .../misc-ming.all/NetStream-SquareTestRunner.cpp   |    2 +-
 testsuite/misc-ming.all/attachMovieTestRunner.cpp  |    4 +-
 testsuite/misc-ming.all/intervalTestRunner.cpp     |    2 +-
 .../movies.all/gravity_embedded-TestRunner.cpp     |    4 +-
 utilities/processor.cpp                            |   30 +---
 55 files changed, 390 insertions(+), 584 deletions(-)


hooks/post-receive
-- 
Gnash



reply via email to

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