View Single Post
  #1  
Old 05-17-2007, 04:41 PM
Twinny Twinny is offline
My empire of dirt
Twinny's Avatar
Join Date: Mar 2006
Location: Australia
Posts: 2,422
Twinny is just really niceTwinny is just really nice
Send a message via AIM to Twinny
Removing objects

Some example code below

PHP Code:
public function load(pl,id)
{
  
obj.(@pl@"_"@id) = new TStaticVar();
  
obj.(@pl@"_"@id).loadvars(some file);
}

public function 
save(pl,id)
{
  
obj.(@pl@"_"@id).savevars(some file, 0);
  
obj.(@pl@"_"@id).destroy();
} 
It seemingly worked well until i noticed that obj retained dynamic vars. When I used my getinfo command on it, I found this
PHP Code:
Object Type: obj.Twinny_1 = 0
Static Vars: 0
Dynamic Vars
: 0 
compared to an active one
PHP Code:
Object Type: obj.Twinny_1 = TStaticVar
Static Vars: initialized,joinedclasses,name,scriptlogmissingfunctions,timeout
Dynamic Vars
: somethingsecret, 
Any reason why the first object should retain the name of the destroyed var? I tried doing obj.clearvars(); and obj = ""; as well as the destroy. Doing obj = ""; is bad since it seems to create a TGraalVar object.

Any hints?
Reply With Quote