blackberry / WebWorks

BlackBerry WebWorks for Smartphones is a platform for building deeply integrated web applications for BlackBerry smartphones
http://developer.blackberry.com/html5
268 stars 51 forks source link

rim:loadingScreen with animated GIF foregroundImage causes Application Resource Monitor on BBOS 7.1 to shut down application after ~30 minutes in background. #126

Open oros opened 11 years ago

oros commented 11 years ago

Not producible if:

Sample config.xml:

<?xml version="1.0" encoding="UTF-8"?>

<widget xmlns="http://www.w3.org/ns/widgets"
    xmlns:rim="http://www.blackberry.com/ns/widgets"
    version="1.0.0.0"
    id="gif"
    xml:lang="en">

<name>GIF</name>
<author>Oros</author>

<content src="index.html"/>
<access uri="*" subdomains="true" />

<rim:cache disableAllCache="true" />

<rim:loadingScreen foregroundImage="loading.gif" onLocalPageLoad="true"> 
    <rim:transitionEffect type="fadeOut"/> 
</rim:loadingScreen>

</widget>

Sample index.html

<!DOCTYPE html>
<html>
<body>
    <div id="loaded"></div>
    <script type="text/javascript">
        /*global window, document, console */

        'use strict';

        function onDOMContentLoaded() {
            window.removeEventListener('DOMContentLoaded', onDOMContentLoaded, false);
            document.querySelector('#loaded').innerHTML = 'Loaded.';
        }

        window.addEventListener('DOMContentLoaded', onDOMContentLoaded, false);
    </script>
</body>
</html>

Allowing the application to start, you will see the loading icon, then the content of the screen (i.e. 'Loaded.') Pressing the End button will minimize the application and letting it run produces the error.

Originally reported here: https://www.blackberry.com/jira/browse/WEBAPI-243

References to AnimatedGIFField can be seen in the event log:

guid:0x9C3CD62E3320B498 time: Mon Aug 06 15:12:01 2012 severity:0 type:3 app:Java Exception data: ForcedStackTraceException 
    VM:AppM MyApp(312) 14 3 
    MyApp(501F87B5) 
        MemoryMaid 
        run 
        0x3168 
guid:0x2DA957ECDECF9B2D time: Mon Aug 06 15:12:01 2012 severity:0 type:2 app:net.rim.appmon data:Thread CPU r=0, t=750 
guid:0x9C3CD62E3320B498 time: Mon Aug 06 15:12:01 2012 severity:0 type:3 app:Java Exception data: ForcedStackTraceException 
    VM:AppM MyApp(312) 250 3 
    MyApp(501F87B5) 
        AnimatedGIFField$AnimatorThread 
        run 
        0x171