I wrote a tiny little Qt4 (C++) application, that doesn't really do much except display a list. It's a QDialog, so pressing escape will close it.
Now, if I do this (run, then close) for about 3 - 8 times in a row, my X session crashes and I get my login screen. This does not happen if I kill my program instead of closing it gracefully.
Naturally, I looked through my code, especially the code that's executed when exiting. However, that's only one tiny little destructor, which deletes some variables that have been previously allocated. Commenting those lines out (-> no more code to be executed when exiting) doesn't change anything. Calling QApplication::exit() will crash as well.
I'm currently using Gnome on this dev system, if that matters.
I don't really know what to look for. Any ideas?
Edit: Trying to find the culprit, I've commented out code, piece by piece. However, I've now basically deleted EVERYTHING except for the code that shows the QDialog and the crashes still happen.
Here's the code:
main.cpp
#include <iostream>
#include <QApplication>
#include <QDialog>
int main(int argc, char *argv[])
{
QApplication app(argc, argv);
return QDialog().exec();
}
As you can see, this program does NOTHING (except show a QDialog, but that's Qt, not my program). I don't get how 2 lines of code (+ the Qt code, which should work, since millions of people use it everyday) can crash my X session. So far, I've tested it on Fedora 16 with Gnome 3 only.
Edit2: Tested it (same binary) on the same system with KDE and LXDE, no crash. Also on Ubuntu with Gnome, KDE and LXDE, no crash. Has to have something to do with Gnome3/Fedora...