Skip to content

Commit

Permalink
Work around deadlock when calling xbmc.executebuildin(Reboot)
Browse files Browse the repository at this point in the history
  • Loading branch information
mglae committed Jan 16, 2021
1 parent 9557255 commit 5a63da8
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
7 changes: 4 additions & 3 deletions resources/lib/modules/system.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
import tarfile
import oeWindows
from xml.dom import minidom
import subprocess

xbmcDialog = xbmcgui.Dialog()

Expand Down Expand Up @@ -393,15 +394,15 @@ def reset_xbmc(self, listItem=None):
open(self.XBMC_RESET_FILE, 'a').close()
oe.winOeMain.close()
oe.xbmcm.waitForAbort(1)
xbmc.executebuiltin('Reboot')
subprocess.call(['/usr/bin/systemctl', '--no-block', 'reboot'], close_fds=True)

@log.log_function()
def reset_oe(self, listItem=None):
if self.ask_sure_reset('Hard') == 1:
open(self.LIBREELEC_RESET_FILE, 'a').close()
oe.winOeMain.close()
oe.xbmcm.waitForAbort(1)
xbmc.executebuiltin('Reboot')
subprocess.call(['/usr/bin/systemctl', '--no-block', 'reboot'], close_fds=True)

@log.log_function()
def ask_sure_reset(self, part):
Expand Down Expand Up @@ -492,7 +493,7 @@ def do_restore(self, listItem=None):
if oe.reboot_counter(10, oe._(32371)) == 1:
oe.winOeMain.close()
oe.xbmcm.waitForAbort(1)
xbmc.executebuiltin('Reboot')
subprocess.call(['/usr/bin/systemctl', '--no-block', 'reboot'], close_fds=True)
else:
log.log('User Abort!')
oe.execute(f'rm -rf {self.RESTORE_DIR}')
Expand Down
2 changes: 1 addition & 1 deletion resources/lib/modules/updates.py
Original file line number Diff line number Diff line change
Expand Up @@ -502,7 +502,7 @@ def do_autoupdate(self, listItem=None, silent=False):
if silent == False:
oe.winOeMain.close()
oe.xbmcm.waitForAbort(1)
xbmc.executebuiltin('Reboot')
subprocess.call(['/usr/bin/systemctl', '--no-block', 'reboot'], close_fds=True)
else:
delattr(self, 'update_in_progress')

Expand Down

0 comments on commit 5a63da8

Please sign in to comment.