Created
March 25, 2012 11:15
-
-
Save gaspard/2192946 to your computer and use it in GitHub Desktop.
Simple Qt module producing bug 24945
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <QtGui/QApplication> | |
#include <QtCore/QTimer> | |
#include <qglobal.h> | |
#include <cstdio> | |
static int app_argc = 0; | |
static char *app_argv[] = {}; | |
static void something() { | |
QString msg("test"); | |
/******************************************************* | |
* This is the code that produces the crash, without * | |
* being called. Just the presence of 'toUtf8' makes * | |
* the dlclose crash with SIGSEGV. * | |
* * | |
* The problem only appears if an application is run. * | |
*******************************************************/ | |
printf("%s\n", msg.toUtf8().data()); | |
} | |
extern "C" { | |
void run_test(bool run_something) { | |
printf("[in mod] Qt lib version: %s.\n", QT_VERSION_STR); | |
if (run_something) { | |
something(); | |
} | |
QApplication *app = new QApplication(app_argc, app_argv); | |
QTimer *timer = new QTimer(app); | |
QObject::connect(timer, SIGNAL(timeout()), | |
app, SLOT(quit())); | |
timer->start(200); | |
app->exec(); | |
delete app; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment