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.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.