Welcome,
Guest
. Please
login
or
register
.
November 24, 2024, 04:02:16 AM
News:
tastyspleen.net discord server:
http://discord.tastyspleen.net
Home
Forum
Help
TinyPortal
Search
Calendar
Login
Register
tastyspleen::quake 2 community
»
Forum
»
The Tech Junkie Boards
»
0x1337c0de
»
AS3 "bad" programming practices
« previous
next »
Print
Pages: [
1
]
Go Down
Author
Topic: AS3 "bad" programming practices (Read 1755 times)
peewee_RotA
Brobdingnagian Member
Posts: 4152
Hi, I'm from the gov'ment and I'm here to help you
Rated:
AS3 "bad" programming practices
«
on:
March 18, 2010, 07:07:20 AM »
You shouldn't attempt to remove object from itself -
it is a bad practice
, and in AS3 you can't do it for sure.
Object may be deleted (i.e. garbage collected) only if there are no references left to that object. Since references always get passed by value and object is generally not aware of which references to it exist, you can't delete object from itself. The only useful thing you can do is to create a method which will clean up all resources used by an instance. Such method will serve as a destructor, but you'll have to call it manually. Don't forget that event listeners will also prevent garbage collection unless you remove them
http://stackoverflow.com/questions/709365/how-do-i-delete-gc-an-object-in-actionscript-3
Aparently in Action Script 3 you are not supposed to clean up objects that your pointers reference. Technically they are not pointers, all variable names are just references to an object that is handled through the interpretor anyway, but this sounds like some backwards advice to me. In order to delete an object I have to delete all of it's pointers and allow the object to still exist.
Basically if I create an array of references (pointers) and fill that array dynamically with objects, every time that I want to pop an object from that stack it is bad practice to delete it. Does this confuse anyone else?
«
Last Edit: March 18, 2010, 07:14:47 AM by peewee_RotA
»
Logged
GOTO ROTAMODS (rocketgib)
GOTO ROTAMAPS (fireworks)
HappyFriar- q2server.fuzzylogicinc.com
Tune in to the
Tastycast!!!!
http://dna.zeliepa.net
[BTF]Sigma
Phenomenally Prodigious Member
Posts: 3059
Rated:
Re: AS3 "bad" programming practices
«
Reply #1 on:
March 18, 2010, 07:48:25 AM »
Logged
Print
Pages: [
1
]
Go Up
« previous
next »
tastyspleen::quake 2 community
»
Forum
»
The Tech Junkie Boards
»
0x1337c0de
»
AS3 "bad" programming practices
El Box de Shoutamente
Last 10 Shouts:
Costigan_Q2
November 11, 2024, 06:41:06 AM
"Stay cozy folks.
Everything is gonna be fine."
There'll be no excuses for having TDS after January 20th, there'll be no excuses AT ALL!!!
|iR|Focalor
November 06, 2024, 03:28:50 AM
RailWolf
November 05, 2024, 03:13:44 PM
Nice
Tom Servo
November 04, 2024, 05:05:24 PM
The Joe Rogan Experience episode 223 that dropped a couple hours ago with Musk, they're talking about Quake lol.
Costigan_Q2
November 04, 2024, 03:37:55 PM
Stay cozy folks.
Everything is gonna be fine.
|iR|Focalor
October 31, 2024, 08:56:37 PM
Costigan_Q2
October 17, 2024, 06:31:53 PM
Not activated your account yet?
Activate it now! join in the fun!
Tom Servo
October 11, 2024, 03:35:36 PM
HAHAHAHAHAHA
|iR|Focalor
October 10, 2024, 12:19:41 PM
I don't worship the devil. Jesus is Lord, friend. He died for your sins. He will forgive you if you just ask.
rikwad
October 09, 2024, 07:57:21 PM
Sorry, I couldn't resist my inner asshole.
Show 50 latest
User
Welcome,
Guest
. Please
login
or
register
.
November 24, 2024, 04:02:16 AM
1 Hour
1 Day
1 Week
1 Month
Forever
Login with username, password and session length
Search
Advanced search