Graal Forums  

Go Back   Graal Forums > Development Forums > Tech Support
FAQ Members List Calendar Today's Posts

Reply
 
Thread Tools Search this Thread Display Modes
  #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 file0);
  
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 Typeobj.Twinny_1 0
Static Vars0
Dynamic Vars

compared to an active one
PHP Code:
Object Typeobj.Twinny_1 TStaticVar
Static Varsinitialized,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
  #2  
Old 05-21-2007, 10:41 AM
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
No-one else had this problem? It seems the parent object maintains a pointer to a deleted child object. Kinda of annoying when i am debugging and such.
Reply With Quote
  #3  
Old 07-13-2007, 12:10 AM
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
Three posts in a row but this problem still exists!
Reply With Quote
  #4  
Old 07-13-2007, 11:40 AM
HolySheepy HolySheepy is offline
Registered User
Join Date: Apr 2007
Posts: 68
HolySheepy is on a distinguished road
try obj = NULL; maybe?
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 05:03 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.