浏览代码

#IQRV #comment:清理图片时机调整,放在循环外

陈纪林80310970 5 月之前
父节点
当前提交
31ee36a2a7
共有 1 个文件被更改,包括 6 次插入7 次删除
  1. 6 7
      Module/mod_IDCertificate/IDCertFSM.cpp

+ 6 - 7
Module/mod_IDCertificate/IDCertFSM.cpp

@@ -567,6 +567,7 @@ int CIDCertFSM::ReadAndScanUTF8(SpReqAnsContext<IDCert_ReadAndScanUTF8_Req, IDCe
 	bool bInvokeReadEx2 = false;
 	bool bExitWhenReading = false;
 	bool bIDCerAuthenticate = false;
+	int curDeleteType = Bmp_ZP;
 
 	while (elapsed < IDCER_READ_TIMEOUT && !bGetIDCert && !m_bCancelRead)
 	{
@@ -810,7 +811,6 @@ int CIDCertFSM::ReadAndScanUTF8(SpReqAnsContext<IDCert_ReadAndScanUTF8_Req, IDCe
 					GetPngBlobEx(ctx->Ans.headphoto, "zp"); //转换头像图片
 
 					ctx->Ans.hasscan = 0;
-					int curDeleteType = Bmp_ZP;
 					if (igestionVer == TRUE) //吸入式设备才调用正反扫描功能
 					{
 						curDeleteType = Bmp_ZP | Bmp_SCAN;
@@ -889,7 +889,6 @@ int CIDCertFSM::ReadAndScanUTF8(SpReqAnsContext<IDCert_ReadAndScanUTF8_Req, IDCe
 					LogWarn(Severity_Low, Error_Succeed, IDCertificate_UserErrorCode_ReadAndScan_GetIDInfo, csIDLogInfo.GetData());
 
 					ctx->Ans.photodata = ctx->Ans.headphoto;
-					DeleteZP(curDeleteType, 2);
 
 					bGetIDCert = true;
 					break;
@@ -898,9 +897,10 @@ int CIDCertFSM::ReadAndScanUTF8(SpReqAnsContext<IDCert_ReadAndScanUTF8_Req, IDCe
 		}
 		dwEnd = SP::Module::Comm::RVCGetTickCount();
 		elapsed = dwEnd - dwStart;
-
 	}
 
+	DeleteZP(curDeleteType, 2);
+
 	if (m_bExit)
 		bExitWhenReading = true;
 
@@ -1129,6 +1129,7 @@ int CIDCertFSM::ReadAndScanUTF8JS(SpReqAnsContext<IDCert_ReadAndScanUTF8JS_Req,
 	bool bInvokeReadEx2 = false;
 	bool bExitWhenReading = false;
 	bool bIDCerAuthenticate = false;
+	int curDeleteType = Bmp_ZP;
 
 	while (elapsed < IDCER_READ_TIMEOUT && !bGetIDCert && !m_bCancelRead)
 	{
@@ -1372,7 +1373,6 @@ int CIDCertFSM::ReadAndScanUTF8JS(SpReqAnsContext<IDCert_ReadAndScanUTF8JS_Req,
 					ctx->Ans.hasscan = 0;
 					GetPngBlobEx(ctx->Ans.headphoto, "zp"); //转换头像图片
 
-					int curDeleteType = Bmp_ZP;
 					if (igestionVer == TRUE) //吸入式设备才调用正反扫描功能
 					{
 						curDeleteType = Bmp_ZP | Bmp_SCAN;
@@ -1450,8 +1450,6 @@ int CIDCertFSM::ReadAndScanUTF8JS(SpReqAnsContext<IDCert_ReadAndScanUTF8JS_Req,
 					LogWarn(Severity_Low, Error_Succeed, IDCertificate_UserErrorCode_ReadAndScan_GetIDInfo, csIDLogInfo.GetData());
 
 					ctx->Ans.photodata = ctx->Ans.headphoto;
-					DeleteZP(curDeleteType, 2);
-
 					bGetIDCert = true;
 					break;
 				}
@@ -1459,9 +1457,10 @@ int CIDCertFSM::ReadAndScanUTF8JS(SpReqAnsContext<IDCert_ReadAndScanUTF8JS_Req,
 		}
 		dwEnd = SP::Module::Comm::RVCGetTickCount();
 		elapsed = dwEnd - dwStart;
-
 	}
 
+	DeleteZP(curDeleteType, 2);
+
 	if (m_bExit)
 		bExitWhenReading = true;