Re-add EventManager check to prevent _call() outside main thread
This commit is contained in:
parent
d2a1763dc8
commit
4bf5c4783b
1 changed files with 3 additions and 0 deletions
|
@ -142,6 +142,9 @@ class EventRoot(object):
|
||||||
def _call(self, path: typing.List[str], kwargs: dict, safe: bool,
|
def _call(self, path: typing.List[str], kwargs: dict, safe: bool,
|
||||||
context: typing.Optional[str], maximum: typing.Optional[int]
|
context: typing.Optional[str], maximum: typing.Optional[int]
|
||||||
) -> typing.List[typing.Any]:
|
) -> typing.List[typing.Any]:
|
||||||
|
if not utils.is_main_thread():
|
||||||
|
raise RuntimeError("Can't call events outside of main thread")
|
||||||
|
|
||||||
returns: typing.List[typing.Any] = []
|
returns: typing.List[typing.Any] = []
|
||||||
path_str = self._path_str(path)
|
path_str = self._path_str(path)
|
||||||
if not path_str in self._hooks:
|
if not path_str in self._hooks:
|
||||||
|
|
Loading…
Reference in a new issue