
Regarding the static creation policy... would it be dangerous to use such a policy if there were static dependencies in use? I am worried that the static storage might be released before the said dependency and then when this last dependency dies it would try to destruct an object living in now inaccessible memory. Is this concern well founded? -Jason

----- Original Message ----- From: "Jason Hise" <chaos@ezequal.com>
Regarding the static creation policy... would it be dangerous to use such a policy if there were static dependencies in use? I am worried that the static storage might be released before the said dependency and then when this last dependency dies it would try to destruct an object living in now inaccessible memory. Is this concern well founded?
There are alternate ways that you might implement the "static dependency" thing that mean there are alternate answers, but the concern (IMO) is well founded, e.g.; important_object top_secret; vs important_object *top_secret = new important_object; if at file scope, these are obviously treated differently by the C runtime (global ctor+dtor). good luck.

I apologize for releasing the new singleton code before I tested it... I got so excited that the changes were done that I wanted to put it up before I had to leave, and now that I have tested it, I found some blatant compilation errors that needed to be corrected. However, I can now say that the code has been tested, the bugs have been fixed, and the longevity lifetimes work perfectly. They even are destroyed in reverse order of creation if they have the save longevity, as the owning longevity registry singleton takes that into account (I'm not just getting lucky with how my version of priority_queue happens to be implemented). at_exit is never used, and there are no source files to be compiled. The new code is uploading now, and should be corrected by the time this message is received. Did I beat Loki yet? ;) Thanks in advance for all replies and further suggestions. -Jason
participants (2)
-
Jason Hise
-
Scott Woods