Hi everybody,

   in the past few evenings I spent some time trying to fix bug 934345 (
https://bugzilla.mozilla.org/show_bug.cgi?id=934345).
At first I thought the crash was related to having an implicit intent
filtered by a broadcast receiver, which could be intercepted by serveral
different builds of fennec (the intent action was the same).

It turned out that it was just a part of the problem, since some crashes
were happening even if Nightly only was installed (
https://bugzilla.mozilla.org/show_bug.cgi?id=934345#c6) .

The other (and trickier) part of the problem was that NotificationHelper,
which is a singleton, was initialized in Application's object onCreate() :
http://mxr.mozilla.org/mozilla-central/source/mobile/android/base/GeckoApplication.java#98

The problem is, if we have more than one *process* per application, which
is the case of Nightly because it triggers UpdateService, we also have more
than one GeckoApplication instance, and all the singletons that are created
there are created multiple times (one for process). An interesting read
about this is
https://groups.google.com/forum/#!msg/android-developers/tI8Po3hPjic/z2IJagJWwvIJ.

This was  a total surprise to me, and I was wondering if it would be good
to file a bug in order to move all those singletons creation somewhere
else, as I did while fixing my bug (which _seems_ to have been fixed).

Hope I was clear enough,
-- 
--------
Federico
_______________________________________________
mobile-firefox-dev mailing list
[email protected]
https://mail.mozilla.org/listinfo/mobile-firefox-dev

Reply via email to