set_weak_flag() for objects?
"Stephen R. van den Berg" <[email protected]>
| Newsgroups | gmane.comp.lang.pike.user |
|---|---|
| Message-ID | <[email protected]> |
What if I have an object like this:
class Server {
private mixed id;
void create() {
id = this;
werror("Created\n");
}
void destroy() {
werror("Destructed\n");
}
}
object ref = Server();
ref = 0; // At this point, I want the object to "selfdestruct"
But the selfdestruct doesn't work because of the internal reference from id
to the class instance.
How can I mark the member id as a weak reference?
--
Stephen.