[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Gnash-commit] /srv/bzr/gnash/trunk r11353: Make TextField class constru
From: |
Benjamin Wolsey |
Subject: |
[Gnash-commit] /srv/bzr/gnash/trunk r11353: Make TextField class constructor non-static. As far as I can tell, this is |
Date: |
Fri, 31 Jul 2009 14:56:49 +0200 |
User-agent: |
Bazaar (1.13.1) |
------------------------------------------------------------
revno: 11353
committer: Benjamin Wolsey <address@hidden>
branch nick: trunk
timestamp: Fri 2009-07-31 14:56:49 +0200
message:
Make TextField class constructor non-static. As far as I can tell, this is
safe. This is preliminary to doing the same for almost all constructors.
modified:
libcore/TextField.cpp
------------------------------------------------------------
revno: 11350.1.1
committer: Benjamin Wolsey <address@hidden>
branch nick: test
timestamp: Fri 2009-07-31 14:26:32 +0200
message:
Modify TextField class init so that it's not static.
modified:
libcore/TextField.cpp
=== modified file 'libcore/TextField.cpp'
--- a/libcore/TextField.cpp 2009-07-31 06:50:45 +0000
+++ b/libcore/TextField.cpp 2009-07-31 12:56:49 +0000
@@ -2364,35 +2364,19 @@
/// limited prototype. This is changed later on instantiation of a
/// TextField.
void
-textfield_class_init(as_object& global, const ObjectURI& uri)
+textfield_class_init(as_object& where, const ObjectURI& uri)
{
- static boost::intrusive_ptr<as_object> cl = NULL;
-
- if (!cl)
- {
- VM& vm = getVM(global);
- Global_as* gl = getGlobal(global);
-
- if (vm.getSWFVersion() < 6) {
- /// Version 5 or less: no initial prototype
- cl = gl->createClass(&textfield_ctor, 0);
- }
- else {
- /// Version 6 upward: limited initial prototype
- as_object* iface = getTextFieldInterface(vm);
- cl = gl->createClass(&textfield_ctor, iface);
- }
-
- vm.addStatic(cl.get());
-
- // replicate static members to class, to be able to access
- // all methods as static functions
- attachTextFieldStaticMembers(*cl);
+
+ VM& vm = getVM(where);
+ Global_as* gl = getGlobal(where);
+ as_object* proto = getSWFVersion(where) < 6 ? 0 :
getTextFieldInterface(vm);
+ as_object* cl = gl->createClass(&textfield_ctor, proto);
+
+ // replicate static members to class, to be able to access
+ // all methods as static functions
+ attachTextFieldStaticMembers(*cl);
- }
-
- // Register _global.TextField
- global.init_member("TextField", cl.get(), as_object::DefaultFlags,
+ where.init_member(getName(uri), cl, as_object::DefaultFlags,
getNamespace(uri));
}
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Gnash-commit] /srv/bzr/gnash/trunk r11353: Make TextField class constructor non-static. As far as I can tell, this is,
Benjamin Wolsey <=