From 14d33d997cfc1949fe93664197097c7cbc6e92e3 Mon Sep 17 00:00:00 2001
From: chenke <chenke@454eff88-639b-444f-9e54-f578c98de674>
Date: 星期三, 19 七月 2017 17:56:34 +0800
Subject: [PATCH] 

---
 RtspFace/PL_Paint.h   |   11 +++--------
 RtspFace/PL_Paint.cpp |   11 ++++++++++-
 2 files changed, 13 insertions(+), 9 deletions(-)

diff --git a/RtspFace/PL_Paint.cpp b/RtspFace/PL_Paint.cpp
index e9318aa..a60b61a 100644
--- a/RtspFace/PL_Paint.cpp
+++ b/RtspFace/PL_Paint.cpp
@@ -7,7 +7,16 @@
 #include <opencv2/core/mat.hpp>
 #include <opencv2/imgproc.hpp>
 
-~PLPLContext::PLPLContext()
+PLPLType::PLPLType(const wchar_t* _val_s)
+{
+    //wchar_t* w_val_s = (wchar_t*)val_s;
+    //for (int i = 0; i < sizeof(val_s) / sizeof(wchar_t); i++)
+    //    w_val_s[i] = _val_s[i];
+
+    memcpy(val_s, _val_s, sizeof(val_s));
+}
+
+PLPLContext::~PLPLContext()
 {
 	delete (CvxText*)cvxText;
 	cvxText = nullptr;
diff --git a/RtspFace/PL_Paint.h b/RtspFace/PL_Paint.h
index a541343..9abfaa0 100644
--- a/RtspFace/PL_Paint.h
+++ b/RtspFace/PL_Paint.h
@@ -31,7 +31,7 @@
 {
 	int val_i;
 	float val_f;
-	char val_s[10];
+	char val_s[20];
 
 	PLPLType() : val_i(0) {}
 	PLPLType(int _val_i) : val_i(_val_i) {}
@@ -41,12 +41,7 @@
 		for (int i = 0; i < sizeof(val_s); i++)
 			val_s[i] = _val_s[i];
 	}
-	PLPLType(const wchar_t* _val_s)
-	{
-		wchar_t* w_val_s = (wchar_t*)val_s;
-		for (int i = 0; i < sizeof(val_s) / sizeof(wchar_t); i++)
-			w_val_s[i] = _val_s[i];
-	}
+	PLPLType(const wchar_t* _val_s);
 };
 
 typedef std::vector<PLPLCmd> plplc_vec_t;
@@ -77,7 +72,7 @@
 	std::string fontPath;
 	
 	PL_Paint_Config() : 
-		copyData(false), plplCtx(nullptr), fontPath(" ")
+		copyData(false), plplCtx(nullptr), fontPath()
 	{ }
 };
 

--
Gitblit v1.8.0