PDA

View Full Version : Segmentation Fault?!



r07f1
11th April 2008, 15:54
Hey there!

I am in the process of learning Qt4... so i have a simple main window and a dialog... since i only want this dialog object to be created if it hasn't already been... i've coded it's calling slot like this:


void MainWindowImpl::newLocalBackup(){
if(!nLocalBackup){
nLocalBackup = new NewLocalBackup;
}
nLocalBackup->show();
}

however every time i click the button the program exits giving me a segmentation fault...

what am i doing wrong? how can i debug this type of error? gosh i'm feeling like a noob =x

thanks in advance for your help *

wysota
11th April 2008, 16:05
You probably forgot to initialize nLocalBackup to 0 in the constructor.

r07f1
11th April 2008, 16:10
yup i did...
i'm sutch a dumb
thanks man!

cheers!
*