Skip navigation
Currently Being Moderated

In Release Build a Singleton class cause crash. Please Help!

Jun 24, 2012 10:02 AM

In a Flex Mobile Project, i'm using a Singleton class for my data like this:

 

private static var instance:ApplicationData;

 

         /**

         *  Returns the sole instance of this Singleton class;

         *  creates it if it does not already exist.

         *

         *  @return Returns the sole instance of this Singleton class;

         *  creates it if it does not already exist.

         */

        public static function getInstance():ApplicationData {

            if (!ApplicationData.instance){

                ApplicationData.instance = new ApplicationData(arguments.callee);

            }

           

            return ApplicationData.instance;

        }

 

somewhere in my view script block tag:

 

private var applicationData:ApplicationData = ApplicationData.getInstance();

 

When a export the release build this cause a crash. I can see just a blanck screen  at startup and nothing else.

In debug version it's working, just in release build!

Any idea? It's an AIR bug?

thanks

 
Replies
  • kglad
    62,007 posts
    Jul 21, 2002
    Currently Being Moderated
    Jun 24, 2012 10:23 AM   in reply to MatteoLegittimo

    what are you trying to do with the reference to getInstance passed to your constructor?

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points