×

Discussion Board

Results 1 to 5 of 5
  1. #1
    Registered User
    Join Date
    Jun 2007
    Posts
    7

    Alloc panic in creating QApplication in Symbian

    Hi

    I am trying to create an instance of QApplication in Appui ConstructL like bellow:

    int argc = 0;
    char **argv = 0;
    QApplication a(argc, argv); delete[] argv;

    But it is giving alloc panic while exiting the applicarion.

    If i comment QApplication a(argc, argv) then i it won't give any panic.



    We have tried the below statement before Qapplication same alloc panic we are getting.

    __crt0(argc, argv, envp);


    can some body explain the reason that why its happening?what is happening internally when we call Qapplication constructor?


    Regards
    Vijay

  2. #2
    Super Contributor
    Join Date
    Nov 2009
    Location
    Minnesota, USA
    Posts
    3,209

    Re: Alloc panic in creating QApplication in Symbian

    Warning: The data referred to by argc and argv must stay valid for the entire lifetime of the QApplication object. In addition, argc must be greater than zero and argv must contain at least one valid character string.
    http://doc.qt.nokia.com/4.6-snapshot/qapplication.html

  3. #3
    Registered User
    Join Date
    Jun 2007
    Posts
    7

    Re: Alloc panic in creating QApplication in Symbian

    Hi Danhicksbyron,

    Thanks for your reply I tried with Class variables also same panic I am getting.
    I found something for the panic.

    In Qapplication they are using some Static global variables which is creating the problem i think.


    Regards,
    Vijay

  4. #4
    Super Contributor
    Join Date
    Nov 2009
    Location
    Minnesota, USA
    Posts
    3,209

    Re: Alloc panic in creating QApplication in Symbian

    Why not just use auto variables, only observe the restriction I quoted?

  5. #5
    Regular Contributor
    Join Date
    Sep 2008
    Posts
    286

    Re: Alloc panic in creating QApplication in Symbian

    Quote Originally Posted by vijay_vrc View Post
    In Qapplication they are using some Static global variables which is creating the problem i think.
    Yes, I believe this is documented issue. In Symbian using __UHEAP_MARK; __UHEAP_MARKEND; - pair which causes the panic when heap is in imbalance at the end marker won't work as Q_GLOBAL_STATIC is not deleted until in global destructors.

Similar Threads

  1. Replies: 0
    Last Post: 2009-11-22, 19:03
  2. Problems with DBMS (Panic Alloc)
    By baroonokia in forum Symbian
    Replies: 4
    Last Post: 2008-11-18, 19:50
  3. Strange ALLOC Panic (Symbian 9)
    By isemenov in forum Symbian
    Replies: 6
    Last Post: 2006-12-21, 10:28
  4. SocketServer ALLOC panic in emulator using RConnection-initiated RHTTPSession?
    By khurshed79 in forum Symbian Networking & Messaging (Closed)
    Replies: 1
    Last Post: 2006-09-21, 08:00
  5. ALLOC Panic, i've found...
    By ViruDoshi in forum Symbian User Interface
    Replies: 3
    Last Post: 2005-12-20, 12:37

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×