Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Shutdown crash #245

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 1 addition & 10 deletions resources/lib/dbus_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,15 +54,6 @@ def manager_unregister_agent(self):
pass


class Bool(int):

def __new__(cls, value):
return int.__new__(cls, bool(value))

def __str__(self):
return '1' if self == True else '0'


class LoopThread(threading.Thread):

def __init__(self, loop):
Expand Down Expand Up @@ -92,7 +83,7 @@ def list_names():

def convert_from_dbussy(data):
if isinstance(data, bool):
return Bool(data)
return str(int(data))
if isinstance(data, dict):
return {key: convert_from_dbussy(data[key]) for key in data.keys()}
if isinstance(data, list):
Expand Down
5 changes: 5 additions & 0 deletions service.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
# Copyright (C) 2013 Lutz Fiebach ([email protected])
# Copyright (C) 2019-present Team LibreELEC (https://libreelec.tv)

import gc
import syspath
import dbus_utils
import oe
Expand Down Expand Up @@ -104,6 +105,10 @@ def run(self):
oe.stop_service()
service_thread.stop()
dbus_utils.LOOP_THREAD.stop()
# Fix crash on shutdown
# See https://github.com/LibreELEC/LibreELEC.tv/issues/5645
chewitt marked this conversation as resolved.
Show resolved Hide resolved
del dbus_utils.BUS
gc.collect()


if __name__ == '__main__':
Expand Down