Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Comparing changes

Choose two branches to see what's changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
base fork: lightspark/lightspark
...
head fork: lightspark/lightspark
Checking mergeability… Don't worry, you can still create the pull request.
  • 2 commits
  • 6 files changed
  • 0 commit comments
  • 1 contributor
View
10 src/scripting/abc.cpp
@@ -77,7 +77,9 @@ DoABCTag::DoABCTag(RECORDHEADER h, std::istream& in):ControlTag(h)
dest+=h.getLength();
LOG(LOG_CALLS,_("DoABCTag"));
- context=new ABCContext(getParseThread()->getRootMovie(), in);
+ RootMovieClip* root=getParseThread()->getRootMovie();
+ root->incRef();
+ context=new ABCContext(_MR(root), in);
int pos=in.tellg();
if(dest!=pos)
@@ -101,7 +103,9 @@ DoABCDefineTag::DoABCDefineTag(RECORDHEADER h, std::istream& in):ControlTag(h)
in >> Flags >> Name;
LOG(LOG_CALLS,_("DoABCDefineTag Name: ") << Name);
- context=new ABCContext(getParseThread()->getRootMovie(), in);
+ RootMovieClip* root=getParseThread()->getRootMovie();
+ root->incRef();
+ context=new ABCContext(_MR(root), in);
int pos=in.tellg();
if(dest!=pos)
@@ -709,7 +713,7 @@ multiname* ABCContext::getMultinameImpl(ASObject* n, ASObject* n2, unsigned int
return ret;
}
-ABCContext::ABCContext(RootMovieClip* r, istream& in):root(r)
+ABCContext::ABCContext(_R<RootMovieClip> r, istream& in):root(r)
{
in >> minor >> major;
LOG(LOG_CALLS,_("ABCVm version ") << major << '.' << minor);
View
4 src/scripting/abc.h
@@ -177,7 +177,7 @@ class ABCContext
friend class ABCVm;
friend class method_info;
public:
- RootMovieClip* root;
+ _R<RootMovieClip> root;
method_info* get_method(unsigned int m);
const tiny_string& getString(unsigned int s) const;
@@ -218,7 +218,7 @@ friend class method_info;
multiname* getMultiname(unsigned int m, call_context* th);
multiname* getMultinameImpl(ASObject* rt1, ASObject* rt2, unsigned int m);
void buildInstanceTraits(ASObject* obj, int class_index);
- ABCContext(RootMovieClip* r, std::istream& in) DLL_PUBLIC;
+ ABCContext(_R<RootMovieClip> r, std::istream& in) DLL_PUBLIC;
void exec(bool lazy);
bool isinstance(ASObject* obj, multiname* name);
View
1  src/scripting/flash/display/flashdisplay.cpp
@@ -31,7 +31,6 @@
#include "backends/rendering.h"
#include "backends/geometry.h"
#include "backends/image.h"
-#include "compat.h"
#include "flash/accessibility/flashaccessibility.h"
#include "argconv.h"
#include "toplevel/Vector.h"
View
14 src/scripting/toplevel/Vector.cpp
@@ -78,7 +78,21 @@ void Vector::sinit(Class_base* c)
c->prototype->setVariableByQName("splice",AS3,Class<IFunction>::getFunction(splice),DYNAMIC_TRAIT);
c->prototype->setVariableByQName("toLocaleString",AS3,Class<IFunction>::getFunction(_toString),DYNAMIC_TRAIT);
c->prototype->setVariableByQName("unshift",AS3,Class<IFunction>::getFunction(unshift),DYNAMIC_TRAIT);
+}
+
+Vector::~Vector()
+{
+ finalize();
+}
+void Vector::finalize()
+{
+ for(unsigned int i=0;i<size();i++)
+ {
+ if(vec[i])
+ vec[i]->decRef();
+ }
+ vec.clear();
}
void Vector::setTypes(const std::vector<Type*>& types)
View
2  src/scripting/toplevel/Vector.h
@@ -43,6 +43,8 @@ class Vector: public ASObject
};
public:
Vector() : vec_type(NULL) {}
+ ~Vector();
+ void finalize();
static void sinit(Class_base* c);
static void buildTraits(ASObject* o) {};
static ASObject* generator(TemplatedClass<Vector>* o_class, ASObject* const* args, const unsigned int argslen);
View
3  src/tightspark.cpp
@@ -112,7 +112,8 @@ int main(int argc, char* argv[])
ifstream f(fileNames[i]);
if(f.is_open())
{
- ABCContext* context=new ABCContext(sys, f);
+ sys->incRef();
+ ABCContext* context=new ABCContext(_MR(sys), f);
contexts.push_back(context);
f.close();
vm->addEvent(NullRef,_MR(new ABCContextInitEvent(context,false)));

No commit comments for this range

Something went wrong with that request. Please try again.