×

Discussion Board

Results 1 to 4 of 4

Hybrid View

  1. #1
    Registered User
    Join Date
    Oct 2009
    Posts
    95

    i have a problem when open a window and close it?

    hello everybody;
    i have a problem when opening a window and close it for 30 times the application crashes and this is done in every window here are the code i used to open the window
    Code:
    void MainWindow::openSupportWindow()
    {
        if(!m_pSupportWindow)
        {
            m_pSupportWindow = new DownloadMainWindow(this);
            m_pSupportWindow->show();
            m_pSupportWindow->loadCustomPage(SUPPORT);
            connect(m_pSupportWindow, SIGNAL(destroyed()), this, SLOT(nullPointer()));
        }
    }
    Code:
    void MainWindow::nullPointer()
    {
        m_pFeedBackWindow = NULL;
        m_pSupportWindow = NULL;
        m_pUpdateWindow = NULL;
    }
    and here are the code i used in the window itself
    Code:
    setAttribute(Qt::WA_DeleteOnClose);
    why my application crashes when i open the window and close it for approximately 30 times?

  2. #2
    Super Contributor
    Join Date
    Oct 2009
    Posts
    4,326

    Re: i have a problem when open a window and close it?

    You can simplify your code by using QPointer:
    http://doc.trolltech.com/4.6/qpointer.html

    What is strange in your code is that you set to 0 three pointers, when one window is destroyed.

    What is the signal, which ends your application execution, is it SIGABRT or SIGSEGV or something else?
    Did you try to analyse core-dumps?

  3. #3
    Super Contributor
    Join Date
    Oct 2009
    Posts
    4,326

    Re: i have a problem when open a window and close it?

    I'm pretty sure there is a bug in your code, so this example is not going to help you, but just for a reference there is an article in a wiki demonstrating dynamic window creation and destruction:
    http://wiki.forum.nokia.com/index.ph...ows_in_Maemo_5

  4. #4
    Super Contributor
    Join Date
    Oct 2009
    Posts
    4,326

    Re: i have a problem when open a window and close it?

    I just wonder why did you provide much more essential details on maemo-developer mailing list than here.
    http://lists.maemo.org/pipermail/mae...ry/024933.html
    Don't you think multi-posting and hiding relevant information is kind of unfriendly behaviour?

Similar Threads

  1. S60 5th edition Emulator: how to close window
    By javaone9 in forum Mobile Java Tools & SDKs
    Replies: 0
    Last Post: 2009-06-26, 05:54
  2. Replies: 8
    Last Post: 2009-02-11, 16:46
  3. Symbolics Window slowing down CodeWarrior
    By olhed in forum Carbide.c++ IDE and plug-ins (Closed)
    Replies: 2
    Last Post: 2006-11-27, 17:30
  4. N90 Case Close with OpenGl ES problem
    By greatape in forum Symbian
    Replies: 1
    Last Post: 2006-10-07, 15:38

Posting Permissions

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