Welcome,
Guest
. Please
login
or
register
.
April 19, 2025, 09:17:22 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 1821 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
April 02, 2025, 02:47:07 AM
Yotematoi
February 14, 2025, 12:41:48 PM
|iR|Focalor
February 13, 2025, 07:31:24 AM
I was on DM this morning for the first time in a pretty long time. Seemed fine to me.
0rbisson
February 13, 2025, 04:54:21 AM
DM server is fucked. 2 point blank rockets from spawn and lava damage and player survived? WTF?" Also someone has fucked with the spawn points, every single time no matter how big the map you spawn right in front of the person who killed you last
rikwad
February 08, 2025, 10:48:18 PM
Seattle FFA now has working HTTP downloads. Thanks Unholy!
RIP Pepp ✟
-Unh0ly-
February 03, 2025, 01:20:14 AM
vvvALL WEAPS HAVE MUZZLE FLASH vvvv
-Unh0ly-
February 03, 2025, 01:03:56 AM
NEW UNHOLY QUAKE 2!!!!
https://drive.google.com/file/d/1E76HYyMapGvP6gUgy04Mve2UsZEL0bb0/view?usp=sharing
|iR|Focalor
December 25, 2024, 12:15:35 AM
|iR|Focalor
December 25, 2024, 12:06:54 AM
RailWolf
December 23, 2024, 09:15:50 AM
Fixed the image for you =)
And Die Hard is a great Christmas movie
Show 50 latest
User
Welcome,
Guest
. Please
login
or
register
.
April 19, 2025, 09:17:22 AM
1 Hour
1 Day
1 Week
1 Month
Forever
Login with username, password and session length
Search
Advanced search