N
news.microsoft.com
We are using concepts described in:
http://www.atalasoft.com/cs/blogs/r...fe-for-scripting-and-hooking-into-events.aspx
(I actually originally found it on a Microsoft website, can't find it at the
moment).
Question, say we have an event defined on our C# object, on which we call
the handlers asynchronously.
public class ComObj
{
private void SomeMethod()
{
A a = new A();
InvokeEvent(MyEvent, a);
}
}
Where InvokeEvent is a helper method that asynchronously invokes any
delegates registered to the event "MyEvent".
In this case, there is an HTML page hosting this ActiveX control. A handler
for "MyEvent" is in place, and correctly gets called.
My question is, what is the garbage collection behavior with regards to the
instance of "A"? Does the Garbage Collector KNOW that the Javascript has a
reference to it? Or, is it going to see the object go out of scope and
potentially clean it up all of a sudden?
Thanks,
Adam
http://www.atalasoft.com/cs/blogs/r...fe-for-scripting-and-hooking-into-events.aspx
(I actually originally found it on a Microsoft website, can't find it at the
moment).
Question, say we have an event defined on our C# object, on which we call
the handlers asynchronously.
public class ComObj
{
private void SomeMethod()
{
A a = new A();
InvokeEvent(MyEvent, a);
}
}
Where InvokeEvent is a helper method that asynchronously invokes any
delegates registered to the event "MyEvent".
In this case, there is an HTML page hosting this ActiveX control. A handler
for "MyEvent" is in place, and correctly gets called.
My question is, what is the garbage collection behavior with regards to the
instance of "A"? Does the Garbage Collector KNOW that the Javascript has a
reference to it? Or, is it going to see the object go out of scope and
potentially clean it up all of a sudden?
Thanks,
Adam