showbase: Fix regressions on Android due to not running on main thread

This commit is contained in:
rdb 2024-11-27 15:57:05 +01:00
parent d6acaaffb0
commit a855071bcf
1 changed files with 2 additions and 2 deletions

View File

@ -679,7 +679,7 @@ class ShowBase(DirectObject.DirectObject):
complete.
"""
if Thread.getCurrentThread() != Thread.getMainThread():
if sys.platform != "android" and Thread.getCurrentThread() != Thread.getMainThread():
task = taskMgr.add(self.destroy, extraArgs=[])
task.wait()
return
@ -3439,7 +3439,7 @@ class ShowBase(DirectObject.DirectObject):
This method must be called from the main thread, otherwise an error is
thrown.
"""
if Thread.getCurrentThread() != Thread.getMainThread():
if Thread.getCurrentThread() != Thread.getMainThread() and sys.platform != "android":
self.notify.error("run() must be called from the main thread.")
return