Skip to content

event事件bug #24

Description

@Gavin991

现象一:
例如:在一个类里面定了一个事件
class One
{
public static event System.Action UserLoginEvent;
.....
UserLoginEvent+=MyFun;
. ....
public void MyFun(int beh)
{
}
}

执行到UserLoginEvent+=MyFun;语句,提示UserLoginEvent为空,暴异常。而是用
UserLoginEvent=MyFun;第一次使用就可以。

现象二:
在上面现象一的基础上,在另外一个类里面。
class Two
{
....
One.UserLoginEvent+=TheOtherFun;
....

public void TheOtherFun(int beh)
{
}
}

执行到UserLoginEvent+=TheOtherFun;语句,提示UserLoginEvent为空,暴异常.而实际应用中,TheOtherFun函数响应了。
类One在类Two之前就先实例化了。

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions