Welcome,
Guest
. Please
login
or
register
.
July 12, 2025, 09:29:44 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 1872 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:
|iR|Focalor
July 04, 2025, 06:33:05 AM
RyU
June 29, 2025, 06:27:46 PM
Q2 must never die
|iR|Focalor
May 26, 2025, 01:17:30 PM
-Unh0ly-
May 24, 2025, 10:08:35 PM
https://drive.google.com/file/d/1qwsj3EM4s5svp0b8oJLZt_An6990RB-o/view?usp=sharing
QUAKE 2 RTX
-Unh0ly-
May 22, 2025, 05:45:28 PM
https://drive.google.com/file/d/1VB1if3QjStPWCpbB33vbx7OOef-Negd3/view?usp=sharing
DUST 2 HD TEXTURES PUT IN BASEQ2 folder
Yotematoi
May 17, 2025, 08:33:15 AM
Yo desde el año 2007 me enfermé de Q2, es incurable
Morir y revivir es costumbre, lástima q el QT estaba bueno
ImperiusDamian
May 12, 2025, 01:45:35 AM
Quake II is not 27 years old. I refuse to accept THAT much time has gone by.
|iR|Focalor
May 11, 2025, 02:33:39 PM
-Unh0ly-
May 03, 2025, 08:02:46 AM
198.179.6.200:30634
Yotematoi
May 02, 2025, 10:27:47 AM
Note for Player-4109 "Remember, the Guinness Book of Records does not include cowards who shot at someone by treachery."
Show 50 latest
User
Welcome,
Guest
. Please
login
or
register
.
July 12, 2025, 09:29:44 AM
1 Hour
1 Day
1 Week
1 Month
Forever
Login with username, password and session length
Search
Advanced search