Superb quality and spec AB-Com PULSe 4K SE. Crazy offer! Only £129! FREE UK DELIVERY! 4K UHD, Enigma 2, Multiboot 4 images & more!...
Superb quality and spec AB-Com PULSe 4K Rev II Twin Satellite tuner only £179! FREE UK DELIVERY! 4K UHD, Enigma 2, SATA HDD facility, Multiboot 4 images & more!...

[MB Premium Twin HD] Crash from pessing red button "too soon".

birdman

Moderator
Joined
Sep 7, 2014
Messages
8,598
Reaction score
119
Points
63
Location
Hitchin, UK
I've just had a crash when stopping a playback and "immediately" pressing the red button to delete it.

The crash seems to be caused by me trying to delete it "too soon" as the screen was still drawing and there was no current item to delete. Here's the crash log: View attachment enigma2_crash_1436125046.log

Looks like a fix (as things shouldn't crash) would be to put some code into a try/except clause. So, in Screens/MovieSelection.py, something like this at the start of def delete
Code:
        try:
                item = self.getCurrentSelection()
        except:
                return

Alternatively, don't bind the keys to function before the screen has been completely initialized....
 
Alternatively, don't bind the keys to function before the screen has been completely initialized....
Which could (possibly) be done by delaying the self.initUserDefinedActions() call in MovieSelection.__init__ - presumably until self.selectedmovie is set, or even until after SelectionEventInfo.__init__(self) is called.
 
This is still a problem, as it's just happened again to me.

The crash log details are essentially the same (but the line numbers on MovieSelection.py are now one lower).
 
PATCH fixing this issue

...so I decided to put some code in place to stop the crash.
All it does is check that there actually is a CurrentSelection before proceeding (teh try/except in #1 wouldn't work - it's the use of item which is the problem), otherwise it just returns.
To test it I also added a print line to show that the quick-return had been activated. This is the patch:

Code:
--- MovieSelection.py.orig.3.2_021
+++ MovieSelection.py
@@ -1927,6 +1927,15 @@
                        # cancelled by user (passing any arg means it's a dialog return)
                        return
                item = self.getCurrentSelection()
+# GML:
+# Just return if there is no current selection.
+# Can happen if you press the red button straight after stopping a
+# recording (while the list of recordings is still being drawn)
+#
+               if not item:
+                       print "GML: PrematureDeletion ignored"
+                       return
+
                current = item[0]
                info = item[1]
                cur_path = os.path.realpath(current.getPath())
I've just watched two recordings and at the end of each pressed "stop" and "red" in quick succession. My debug log shows this:
Code:
root@mbtwin:/media/usb/logs# grep GML: Enigma2-13-11-2015_00-15-18.log
GML: PrematureDeletion ignored
GML: PrematureDeletion ignored
root@mbtwin:/media/usb/logs#
so it works. Essentially the early press is ignored, and there is no enigma2 crash.
 

OpenViX Feeds Status

Back
Top