“36bf71243cb59e077204b4d323aba92ec04bc07b”上不存在“benchmark/PaddleOCR_DBNet/test_tipc/benchmark_train.sh”
未验证 提交 0f3a8a4b 编写于 作者: H H-ZeX

fix #304

Signed-off-by: NH-ZeX <hzx20112012@gmail.com>
上级 34efa468
...@@ -223,6 +223,7 @@ int taosOpenUDServerSocket(char *ip, short port) { ...@@ -223,6 +223,7 @@ int taosOpenUDServerSocket(char *ip, short port) {
return sockFd; return sockFd;
} }
// The callback functions MUST free the param pass to it after finishing use it.
int taosInitTimer(void *(*callback)(void *), int ms) { int taosInitTimer(void *(*callback)(void *), int ms) {
/******************************************************** /********************************************************
* Create SIGALRM loop thread * Create SIGALRM loop thread
...@@ -237,9 +238,10 @@ int taosInitTimer(void *(*callback)(void *), int ms) { ...@@ -237,9 +238,10 @@ int taosInitTimer(void *(*callback)(void *), int ms) {
return -1; return -1;
} }
int *tms = (int *)malloc(sizeof(int)); int *tms = (int *) malloc(sizeof(int));
*tms = ms; *tms = ms;
if (pthread_create(&thread, &tattr, callback, (void *)tms)) { if (pthread_create(&thread, &tattr, callback, (void *) tms)) {
free(tms);
return -1; return -1;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册