I want to have method object in a class but get errors about circular reference. So I tried to use the weak() modifier but couldn't get it to work. Is this not supposed to work? Am I doing something wrong?
The following code works just fine without the .weak() call but causes the circular reference error on exit. With .Weak() I get an error "Could not find Symbol invoke" when I try to call methodref.invoke().
class A
{
var methodref;
function initialize()
{
methodref = method(:doSomething).weak();
}
function callDoSomething()
{
methodref.invoke();
}
function doSomething()
{
}
}