refs #248 fixed a GCC warning

This commit is contained in:
Mathew Sutcliffe
2014-06-14 21:54:20 +01:00
parent edec05e41a
commit ae5ce81d7f

View File

@@ -85,6 +85,8 @@ class QSharedApplication : public QApplication
m_weakptr = ptr; m_weakptr = ptr;
} }
static char *strdup(const char *s) { auto s2 = static_cast<char *>(std::malloc(std::strlen(s))); return std::strcpy(s2, s); }
public: public:
/*! /*!
* Returns a shared pointer to the QApplication. * Returns a shared pointer to the QApplication.
@@ -97,7 +99,7 @@ public:
if (! instance()) if (! instance())
{ {
static int argc = 1; static int argc = 1;
static char *argv[] = { "X-Plane" }; static char *argv[] = { strdup("X-Plane") };
new QSharedApplication(ptr, argc, argv); new QSharedApplication(ptr, argc, argv);
} }
if (! instance()->inherits("QSharedApplication")) if (! instance()->inherits("QSharedApplication"))