PDA

View Full Version : MSVC2008 debugger hangs after adding a further QSettings group...



sepp
28th February 2011, 12:47
Hi all,

i have a problem with my application. i have a QmainWindow derivate called myMainWindow. In it's ctor i'm calling a function loadSetting() beeing a private member of myMainWindow. The correspondant function saveSettings() is called in myMainWindow::closeEvent(). This approach worked fine through several versions of my application.

I recently added a new group to both loadSettings():


settings.beginGroup("Other Options");
double factor=settings.value("my factor",1.2).toDouble();
doSomeThing(factor);
settings.endGroup();


and saveSettings():


settings.beginGroup("Other Options");
settings.setValue("my factor",getFactor());
settings.endGroup();

I'm building this code in MSVC2008 as 32 bit code, and running on Windows 7 32 bit. The release code works, and the registry keys all look ok. The debug code is running outside MSVC2008 debugger, too. However, if i want to debug my app in MSVC2008, the debugger hangs, and win7 tells me that MSVC2008 is busy. After a minute or so, i can step to the next expression in the debugger, and again i have to wait a minute...

Before i added the statements above, all was running fine. Without these lines, i can step into loadSettings(), the debugger is reactive, and i can switch beteen the main thread and the other thread running at that moment: a QFileInfoGatherer. My app uses a QTreeView along with a QFileSystemModel.

Any ideas?

Regards, sepp

sepp
1st March 2011, 13:14
Well, although i have no solution for the problem and no idea why it happens: if i set a breakpoint later in my loadSettings() function instead on the first expression, all is fine. Hmm. Maybe some race condition?

mcosta
1st March 2011, 17:00
what happens in doSomeThing(factor)???