Results 1 to 6 of 6

Thread: Segmentation Fault when accesing more than once

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jan 2012
    Location
    Argentina
    Posts
    167
    Thanks
    33
    Thanked 10 Times in 10 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Segmentation Fault when accesing more than once

    OK i dont know if it is the hour or what but this lines cause the program to finish unexpectedly, only if the process is called more than once. I mean everything goes fine when i click the button for the first time but if I click it again bamm app exits:

    Qt Code:
    1. RandomInfo *randurl = new RandomInfo ();
    2. if (url.contains (QString ("ya_cerramos")))
    3. bg = QPixmap (url);
    4. else{
    5. bg = QPixmap (randurl->getRandomUrl ());
    6. }
    7. this->ui->label_imagen->setPixmap (bg);
    8. QStringList frase_autor = QStringList ();
    9. frase_autor = randurl->getFraseRandom ();
    To copy to clipboard, switch view to plain text mode 



    PS: this is the code of the method that returns the list, just in case:

    Qt Code:
    1. QStringList frase_autor;
    2. frase_autor << query->value (1).toString ().trimmed ()<< query->value (2).toString ().trimmed ();
    3. return frase_autor;
    To copy to clipboard, switch view to plain text mode 

    BTW i dont get any error while executing this, the list is returned...the problem is when I assign the return list to the list of the mainclass...
    Last edited by KillGabio; 11th February 2012 at 07:50.

Similar Threads

  1. QWT - Segmentation Fault
    By Wojtek.wk in forum Newbie
    Replies: 0
    Last Post: 17th April 2010, 14:29
  2. segmentation fault
    By navid in forum Qt Programming
    Replies: 3
    Last Post: 20th December 2009, 11:40
  3. Segmentation fault
    By Schimanski in forum Qt Programming
    Replies: 20
    Last Post: 31st August 2009, 16:26
  4. Segmentation Fault?!
    By r07f1 in forum Newbie
    Replies: 2
    Last Post: 11th April 2008, 15:10
  5. Segmentation Fault
    By merry in forum General Programming
    Replies: 4
    Last Post: 12th March 2007, 04:08

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Qt is a trademark of The Qt Company.