Quote:
Originally Posted by Restraint
In theory, you are correct. It *should* never be garbage collected. However, it often is.
I ran into this problem thrice: once for a jailing/punishments system, once for a Graphics Viewer system, and once for some system I don't recall.
They all had active references, namely this.'s that were initialized onCreated. 2 of them were in DB NPCs, and 1 was in a Weapon NPC. They DO appear to have some arbitrary time limit.
If you never ran into it -- and I'm not doubting you -- I'm sure we can chalk this up as one of those "random Graal glitches."
I agree with you entirely with regards to SQLite Database and caching. I have also done similar with file databases and caching. Such caches make it very easy to submit data to the clientside as well (Again, via .saveVarsToArray()).
|
are you using the default onInitialized() event within database npcs as well?
i have always set up database systems in the following way:
PHP Code:
function onCreated()
this.onInitialized();
function onInitialized() {
if (this.cache == NULL) {
this.cache = new tStaticVar();
this.populateCache();
}
}
even prior to the introduction of tStaticVar() you needed to use onInitialize() within a database npc for it to be reliable