diff options
-rw-r--r-- | src/qlibwindowmanager.cpp | 3 | ||||
-rw-r--r-- | src/qlibwindowmanager.h | 2 |
2 files changed, 2 insertions, 3 deletions
diff --git a/src/qlibwindowmanager.cpp b/src/qlibwindowmanager.cpp index b5fad2c..bc313e5 100644 --- a/src/qlibwindowmanager.cpp +++ b/src/qlibwindowmanager.cpp @@ -33,8 +33,7 @@ int QLibWindowmanager::init(int port, const QString &token) { int QLibWindowmanager::requestSurface(const QString &label) { string cstr = label.toStdString(); - applabel = new char[cstr.length() + 1]; - memcpy(applabel, cstr.c_str(), cstr.length() + 1); + applabel = strdup(cstr.c_str()); json_object *obj = json_object_new_object(); json_object_object_add(obj, wm->kKeyDrawingName, json_object_new_string(applabel)); diff --git a/src/qlibwindowmanager.h b/src/qlibwindowmanager.h index f07a312..6b796f6 100644 --- a/src/qlibwindowmanager.h +++ b/src/qlibwindowmanager.h @@ -59,7 +59,7 @@ public slots: private: LibWindowmanager* wm; - char* applabel; + const char* applabel; bool isActive; }; |