BTW hmmm what about this:

interface Foo { }

class Bar : Foo, RCObject {}

class Pwned : Foo {}

void main() {
   Foo bar = new Bar();
   /* where is bar.Release() called? */
   Foo pwned = new Pwned();
/* better hope pwned.Release() isn't called cuz that's impossible */
}


I *believe* IUnknown interfaces are special and a separate category from regular D interfaces, so this would be statically disallowed.

But with the RCObject, we need to be careful about implicit casting to interfaces transparently killing memory safety.

of course then we might be weakening their usefulness. gah we just need scope references, then we can pass the interface with confidence that it won't be escaped. yeah yeah i know i sound like a broken record.

Reply via email to