mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-10 14:07:35 +08:00
refs #248 fixed a GCC warning
This commit is contained in:
@@ -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"))
|
||||||
|
|||||||
Reference in New Issue
Block a user