1 // impl.cpp: Implement ActionScript tags, movie loading, library, for Gnash.
3 // Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010 Free Software
6 // This program is free software; you can redistribute it and/or modify
7 // it under the terms of the GNU General Public License as published by
8 // the Free Software Foundation; either version 3 of the License, or
9 // (at your option) any later version.
11 // This program is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 // GNU General Public License for more details.
16 // You should have received a copy of the GNU General Public License
17 // along with this program; if not, write to the Free Software
18 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
21 #include "MovieFactory.h"
22 #include "smart_ptr.h" // GNASH_USE_GC
23 #include "IOChannel.h"
27 #include "GnashImage.h"
28 #include "sprite_definition.h"
29 #include "SWFMovieDefinition.h"
30 #include "BitmapMovieDefinition.h"
31 #include "RunResources.h"
33 #include "StreamProvider.h"
34 #include "MovieClip.h"
36 #include "MovieLibrary.h"
37 #include "gnash.h" // DSOEXPORTS
45 #include <memory> // for auto_ptr
52 // global gnash management
55 // Maximum release of resources.
58 // Ideally, we should make sure that function properly signals all threads
59 // about exiting and giving them a chance to cleanly exit.
61 // If we clear shared memory here we're going to leave threads possibly
62 // accessing deleted memory, which would trigger a segfault.
64 // My experience is that calling exit(), altought it has the same problem,
65 // reduces the chances of segfaulting ...
67 // We want this fixed anyway as exit()
68 // itselt can also trigger segfaults.
70 // See task task #6959 and depending items
72 log_debug("Any segfault past this message is likely due to improper "
77 MovieFactory::movieLibrary
.clear();
81 GC::get().fuzzyCollect(); // why would this be needed ?
89 /// A GC root used to mark all reachable collectable pointers
90 class GnashGcRoot
: public GcRoot
99 void markReachableResources() const
101 VM::get().markReachableResources();
109 static GnashGcRoot gcRoot
;
118 // indent-tabs-mode: t