Do event subscribers keep broadcasters alive and vice-versa?
May be a stupid question, but I hadn't thought of this until now. Does an object being subscribed to a broadcaster keep that broadcaster alive when there's no other references to it? What about the opposite, does a subscriber stay alive as long as it's subscribed to another object?
5 Replies
Also, what's the best way to test this? I'm struggling to set up a proper test for this, the finalizers don't seem to be called.
iirc, no to the first and yes to the second
because the delegate holds a reference to the subscriber
thanks
it would be nice to be able to test this, but it's proving difficult
are you forcing a GC collection?
Yeah, no matter what the finalizer is not called