Browse Source

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

rdb 1 year ago
parent
commit
a855071bcf
1 changed files with 2 additions and 2 deletions
  1. 2 2
      direct/src/showbase/ShowBase.py

+ 2 - 2
direct/src/showbase/ShowBase.py

@@ -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